當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserList::staticGet方法代碼示例

本文整理匯總了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');
 }
開發者ID:victorfcm,項目名稱:VuFind-Plus,代碼行數:25,代碼來源:CiteList.php

示例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');
 }
開發者ID:victorfcm,項目名稱:VuFind-Plus,代碼行數:42,代碼來源:EditList.php


注:本文中的UserList::staticGet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。