本文整理汇总了PHP中UserList::staticGet方法的典型用法代码示例。如果您正苦于以下问题:PHP UserList::staticGet方法的具体用法?PHP UserList::staticGet怎么用?PHP UserList::staticGet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserList
的用法示例。
在下文中一共展示了UserList::staticGet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: launch
function launch()
{
global $interface;
//Get all lists for the user
// Fetch List object
if (isset($_REQUEST['id'])) {
/** @var UserList $list */
$list = UserList::staticGet($_GET['listId']);
}
$interface->assign('favList', $list);
// Get all titles on the list
// $favorites = $list->getListEntries();
// $favList = new FavoriteHandler($favorites, null, $list->id, false);
//TODO: test this
$favList = new FavoriteHandler($list, null, false);
$citationFormat = $_REQUEST['citationFormat'];
$citationFormats = CitationBuilder::getCitationFormats();
$interface->assign('citationFormat', $citationFormats[$citationFormat]);
$citations = $favList->getCitations($citationFormat);
$interface->assign('citations', $citations);
// Display Page
$interface->assign('listId', strip_tags($_REQUEST['id']));
$interface->setTemplate('listCitations.tpl');
$interface->display('layout.tpl');
}
示例2: launch
/**
* Process parameters and display the page.
*
* @return void
* @access public
*/
public function launch()
{
global $interface;
global $configArray;
if (!($user = UserAccount::isLoggedIn())) {
include_once 'Login.php';
MyAccount_Login::launch();
exit;
}
// Fetch List object
$list = UserList::staticGet($_GET['id']);
// Ensure user have privs to view the list
if ($list->user_id != $user->id) {
PEAR_Singleton::raiseError(new PEAR_Error(translate('list_access_denied')));
}
// Save Data
if (isset($_POST['submit'])) {
if (empty($_POST['title'])) {
$interface->assign('errorMsg', 'list_edit_name_required');
} else {
if ($this->_saveChanges($user, $list)) {
// After changes are saved, send the user back to an appropriate page
$nextAction = 'MyList/' . $list->id;
header('Location: ' . $configArray['Site']['path'] . '/MyResearch/' . $nextAction);
exit;
} else {
// List was not edited
$interface->assign('errorMsg', 'edit_list_fail');
}
}
}
// Send list to template so title/description can be displayed:
$interface->assign('list', $list);
$interface->setTemplate('editList.tpl');
$interface->display('layout.tpl');
}