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


PHP Gdn_Theme::Section方法代碼示例

本文整理匯總了PHP中Gdn_Theme::Section方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gdn_Theme::Section方法的具體用法?PHP Gdn_Theme::Section怎麽用?PHP Gdn_Theme::Section使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Gdn_Theme的用法示例。


在下文中一共展示了Gdn_Theme::Section方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Initialize

 /**
  * Hightlight menu path. Automatically run on every use.
  *
  * @since 2.0.0
  * @access public
  */
 public function Initialize()
 {
     parent::Initialize();
     Gdn_Theme::Section('Dashboard');
     if ($this->Menu) {
         $this->Menu->HighlightRoute('/dashboard/settings');
     }
 }
開發者ID:elpum,項目名稱:TgaForumBundle,代碼行數:14,代碼來源:class.settingscontroller.php

示例2: PluginController_FileUpload_Create

 public function PluginController_FileUpload_Create($Sender)
 {
     $Sender->Title('FileUpload');
     $Sender->AddSideMenu('plugin/fileupload');
     Gdn_Theme::Section('Dashboard');
     $Sender->Form = new Gdn_Form();
     $this->EnableSlicing($Sender);
     $this->Dispatch($Sender, $Sender->RequestArgs);
 }
開發者ID:SatiricMan,項目名稱:addons,代碼行數:9,代碼來源:class.fileupload.plugin.php

示例3: Initialize

 public function Initialize()
 {
     parent::Initialize();
     Gdn_Theme::Section('Dashboard');
     $this->Model = new DBAModel();
     $this->Form = new Gdn_Form();
     $this->Form->InputPrefix = '';
     $this->AddJsFile('dba.js');
 }
開發者ID:3marproof,項目名稱:vanilla,代碼行數:9,代碼來源:class.dbacontroller.php

示例4: Index

 /**
  * Default search functionality.
  *
  * @since 2.0.0
  * @access public
  * @param int $Page Page number.
  */
 public function Index($Page = '')
 {
     $this->AddJsFile('search.js');
     $this->Title(T('Search'));
     SaveToConfig('Garden.Format.EmbedSize', '160x90', FALSE);
     Gdn_Theme::Section('SearchResults');
     list($Offset, $Limit) = OffsetLimit($Page, C('Garden.Search.PerPage', 20));
     $this->SetData('_Limit', $Limit);
     $Search = $this->Form->GetFormValue('Search');
     $Mode = $this->Form->GetFormValue('Mode');
     if ($Mode) {
         $this->SearchModel->ForceSearchMode = $Mode;
     }
     try {
         $ResultSet = $this->SearchModel->Search($Search, $Offset, $Limit);
     } catch (Gdn_UserException $Ex) {
         $this->Form->AddError($Ex);
         $ResultSet = array();
     } catch (Exception $Ex) {
         LogException($Ex);
         $this->Form->AddError($Ex);
         $ResultSet = array();
     }
     Gdn::UserModel()->JoinUsers($ResultSet, array('UserID'));
     // Fix up the summaries.
     $SearchTerms = explode(' ', Gdn_Format::Text($Search));
     foreach ($ResultSet as &$Row) {
         $Row['Summary'] = SearchExcerpt(Gdn_Format::PlainText($Row['Summary'], $Row['Format']), $SearchTerms);
         $Row['Summary'] = Emoji::instance()->translateToHtml($Row['Summary']);
         $Row['Format'] = 'Html';
     }
     $this->SetData('SearchResults', $ResultSet, TRUE);
     $this->SetData('SearchTerm', Gdn_Format::Text($Search), TRUE);
     if ($ResultSet) {
         $NumResults = count($ResultSet);
     } else {
         $NumResults = 0;
     }
     if ($NumResults == $Offset + $Limit) {
         $NumResults++;
     }
     // Build a pager
     $PagerFactory = new Gdn_PagerFactory();
     $this->Pager = $PagerFactory->GetPager('MorePager', $this);
     $this->Pager->MoreCode = 'More Results';
     $this->Pager->LessCode = 'Previous Results';
     $this->Pager->ClientID = 'Pager';
     $this->Pager->Configure($Offset, $Limit, $NumResults, 'dashboard/search/%1$s/%2$s/?Search=' . Gdn_Format::Url($Search));
     //		if ($this->_DeliveryType != DELIVERY_TYPE_ALL) {
     //         $this->SetJson('LessRow', $this->Pager->ToString('less'));
     //         $this->SetJson('MoreRow', $this->Pager->ToString('more'));
     //         $this->View = 'results';
     //      }
     $this->CanonicalUrl(Url('search', TRUE));
     $this->Render();
 }
開發者ID:3marproof,項目名稱:vanilla,代碼行數:63,代碼來源:class.searchcontroller.php

示例5: Initialize

 /**
  * Make this look like a dashboard page and add the resources
  *
  * @since 1.0
  * @access public
  */
 public function Initialize()
 {
     parent::Initialize();
     $this->Application = 'Yaga';
     Gdn_Theme::Section('Dashboard');
     if ($this->Menu) {
         $this->Menu->HighlightRoute('/rank');
     }
     $this->AddJsFile('jquery-ui-1.10.0.custom.min.js');
     $this->AddJsFile('admin.ranks.js');
 }
開發者ID:hxii,項目名稱:Application-Yaga,代碼行數:17,代碼來源:class.rankcontroller.php

示例6: Initialize

 /**
  * Make this look like a dashboard page and add the resources
  *
  * @since 1.0
  * @access public
  */
 public function Initialize()
 {
     parent::Initialize();
     $this->Application = 'Yaga';
     Gdn_Theme::Section('Dashboard');
     if ($this->Menu) {
         $this->Menu->HighlightRoute('/badge');
     }
     $this->AddJsFile('admin.badges.js');
     $this->AddCssFile('badges.css');
 }
開發者ID:hxii,項目名稱:Application-Yaga,代碼行數:17,代碼來源:class.badgecontroller.php

示例7: Initialize

 /**
  * Make this look like a dashboard page and add the resources
  *
  * @since 1.0
  * @access public
  */
 public function Initialize()
 {
     parent::Initialize();
     $this->Application = 'Yaga';
     Gdn_Theme::Section('Dashboard');
     if ($this->Menu) {
         $this->Menu->HighlightRoute('/yaga');
     }
     $this->AddSideMenu('yaga/settings');
     $this->AddCssFile('yaga.css');
 }
開發者ID:hxii,項目名稱:Application-Yaga,代碼行數:17,代碼來源:class.yagacontroller.php

示例8: Initialize

 /**
  * Include JS and CSS used by all methods.
  *
  * Always called by dispatcher before controller's requested method.
  *
  * @since 2.0.0
  * @access public
  */
 public function Initialize()
 {
     $this->Head = new HeadModule($this);
     $this->Head->AddTag('meta', array('name' => 'robots', 'content' => 'noindex'));
     $this->AddJsFile('jquery.js');
     $this->AddJsFile('jquery.livequery.js');
     $this->AddJsFile('jquery.form.js');
     $this->AddJsFile('jquery.popup.js');
     $this->AddJsFile('jquery.gardenhandleajaxform.js');
     $this->AddJsFile('global.js');
     $this->AddCssFile('style.css');
     parent::Initialize();
     Gdn_Theme::Section('Entry');
 }
開發者ID:edward-tsai,項目名稱:vanilla4china,代碼行數:22,代碼來源:class.entrycontroller.php

示例9: Initialize

 /**
  * Include JS, CSS, and modules used by all methods.
  *
  * Always called by dispatcher before controller's requested method.
  * 
  * @since 2.0.0
  * @access public
  */
 public function Initialize()
 {
     $this->Head = new HeadModule($this);
     $this->AddJsFile('jquery.js');
     $this->AddJsFile('jquery.livequery.js');
     $this->AddJsFile('jquery.form.js');
     $this->AddJsFile('jquery.popup.js');
     $this->AddJsFile('jquery.gardenhandleajaxform.js');
     $this->AddJsFile('global.js');
     $this->AddCssFile('style.css');
     // Add Modules
     $this->AddModule('GuestModule');
     $this->AddModule('SignedInModule');
     parent::Initialize();
     Gdn_Theme::Section('ActivityList');
     $this->SetData('Breadcrumbs', array(array('Name' => T('Activity'), 'Url' => '/activity')));
 }
開發者ID:statico,項目名稱:openshift-origin-vanillaforums,代碼行數:25,代碼來源:class.activitycontroller.php

示例10: Initialize

 /**
  * Adds JS, CSS, & modules. Automatically run on every use.
  *
  * @since 2.0.0
  * @access public
  */
 public function Initialize()
 {
     $this->ModuleSortContainer = 'Profile';
     $this->Head = new HeadModule($this);
     $this->AddJsFile('jquery.js');
     $this->AddJsFile('jquery.livequery.js');
     $this->AddJsFile('jquery.form.js');
     $this->AddJsFile('jquery.popup.js');
     $this->AddJsFile('jquery.gardenhandleajaxform.js');
     $this->AddJsFile('global.js');
     $this->AddCssFile('style.css');
     $this->AddModule('GuestModule');
     parent::Initialize();
     Gdn_Theme::Section('Profile');
     if ($this->EditMode) {
         $this->CssClass .= 'EditMode';
     }
     $this->SetData('Breadcrumbs', array());
 }
開發者ID:robhazkes,項目名稱:Garden,代碼行數:25,代碼來源:class.profilecontroller.php

示例11: Initialize

 /**
  * Highlight route and do authenticator setup.
  *
  * Always called by dispatcher before controller's requested method.
  * 
  * @since 2.0.3
  * @access public
  */
 public function Initialize()
 {
     parent::Initialize();
     Gdn_Theme::Section('Dashboard');
     if ($this->Menu) {
         $this->Menu->HighlightRoute('/dashboard/authentication');
     }
     $this->EnableSlicing($this);
     $Authenticators = Gdn::Authenticator()->GetAvailable();
     $this->ChooserList = array();
     $this->ConfigureList = array();
     foreach ($Authenticators as $AuthAlias => $AuthConfig) {
         $this->ChooserList[$AuthAlias] = $AuthConfig['Name'];
         $Authenticator = Gdn::Authenticator()->AuthenticateWith($AuthAlias);
         $ConfigURL = is_a($Authenticator, "Gdn_Authenticator") && method_exists($Authenticator, 'AuthenticatorConfiguration') ? $Authenticator->AuthenticatorConfiguration($this) : FALSE;
         $this->ConfigureList[$AuthAlias] = $ConfigURL;
     }
     $this->CurrentAuthenticationAlias = Gdn::Authenticator()->AuthenticateWith('default')->GetAuthenticationSchemeAlias();
 }
開發者ID:elpum,項目名稱:TgaForumBundle,代碼行數:27,代碼來源:class.authenticationcontroller.php

示例12: Index

 /**
  * Default all drafts view: chronological by time saved.
  * 
  * @since 2.0.0
  * @access public
  * 
  * @param int $Offset Number of drafts to skip.
  */
 public function Index($Offset = '0')
 {
     Gdn_Theme::Section('DiscussionList');
     // Setup head
     $this->Permission('Garden.SignIn.Allow');
     $this->AddCssFile('vanilla.css');
     $this->AddJsFile('jquery.gardenmorepager.js');
     $this->AddJsFile('discussions.js');
     $this->Title(T('My Drafts'));
     // Validate $Offset
     if (!is_numeric($Offset) || $Offset < 0) {
         $Offset = 0;
     }
     // Set criteria & get drafts data
     $Limit = Gdn::Config('Vanilla.Discussions.PerPage', 30);
     $Session = Gdn::Session();
     $Wheres = array('d.InsertUserID' => $Session->UserID);
     $this->DraftData = $this->DraftModel->Get($Session->UserID, $Offset, $Limit);
     $CountDrafts = $this->DraftModel->GetCount($Session->UserID);
     // Build a pager
     $PagerFactory = new Gdn_PagerFactory();
     $this->Pager = $PagerFactory->GetPager('MorePager', $this);
     $this->Pager->MoreCode = 'More drafts';
     $this->Pager->LessCode = 'Newer drafts';
     $this->Pager->ClientID = 'Pager';
     $this->Pager->Configure($Offset, $Limit, $CountDrafts, 'drafts/%1$s');
     // Deliver JSON data if necessary
     if ($this->_DeliveryType != DELIVERY_TYPE_ALL) {
         $this->SetJson('LessRow', $this->Pager->ToString('less'));
         $this->SetJson('MoreRow', $this->Pager->ToString('more'));
         $this->View = 'drafts';
     }
     // Add modules
     $this->AddModule('DiscussionFilterModule');
     $this->AddModule('NewDiscussionModule');
     $this->AddModule('CategoriesModule');
     $this->AddModule('BookmarkedModule');
     // Render default view (drafts/index.php)
     $this->Render();
 }
開發者ID:edward-tsai,項目名稱:vanilla4china,代碼行數:48,代碼來源:class.draftscontroller.php

示例13: Initialize

 /**
  * Always triggered first. Add Javascript files.
  *
  * @since 2.0.?
  * @access public
  */
 public function Initialize()
 {
     parent::Initialize();
     Gdn_Theme::Section('Dashboard');
     $this->AddJsFile('log.js');
     $this->AddJsFile('jquery.expander.js');
     $this->AddJsFile('jquery-ui.js');
     $this->Form->InputPrefix = '';
 }
開發者ID:bishopb,項目名稱:vanilla,代碼行數:15,代碼來源:class.logcontroller.php

示例14: Mine

 /**
  * Display discussions started by the user.
  *
  * @since 2.0.0
  * @access public
  *
  * @param int $Offset Number of discussions to skip.
  */
 public function Mine($Page = 'p1')
 {
     $this->Permission('Garden.SignIn.Allow');
     Gdn_Theme::Section('DiscussionList');
     // Set criteria & get discussions data
     list($Offset, $Limit) = OffsetLimit($Page, C('Vanilla.Discussions.PerPage', 30));
     $Session = Gdn::Session();
     $Wheres = array('d.InsertUserID' => $Session->UserID);
     $DiscussionModel = new DiscussionModel();
     $this->DiscussionData = $DiscussionModel->Get($Offset, $Limit, $Wheres);
     $this->SetData('Discussions', $this->DiscussionData);
     $CountDiscussions = $this->SetData('CountDiscussions', $DiscussionModel->GetCount($Wheres));
     $this->View = 'index';
     if (C('Vanilla.Discussions.Layout') === 'table') {
         $this->View = 'table';
     }
     // Build a pager
     $PagerFactory = new Gdn_PagerFactory();
     $this->EventArguments['PagerType'] = 'MorePager';
     $this->FireEvent('BeforeBuildMinePager');
     $this->Pager = $PagerFactory->GetPager($this->EventArguments['PagerType'], $this);
     $this->Pager->MoreCode = 'More Discussions';
     $this->Pager->LessCode = 'Newer Discussions';
     $this->Pager->ClientID = 'Pager';
     $this->Pager->Configure($Offset, $Limit, $CountDiscussions, 'discussions/mine/%1$s');
     $this->SetData('_PagerUrl', 'discussions/mine/{Page}');
     $this->SetData('_Page', $Page);
     $this->SetData('_Limit', $Limit);
     $this->FireEvent('AfterBuildMinePager');
     // Deliver JSON data if necessary
     if ($this->_DeliveryType != DELIVERY_TYPE_ALL) {
         $this->SetJson('LessRow', $this->Pager->ToString('less'));
         $this->SetJson('MoreRow', $this->Pager->ToString('more'));
         $this->View = 'discussions';
     }
     // Add modules
     $this->AddModule('DiscussionFilterModule');
     $this->AddModule('NewDiscussionModule');
     $this->AddModule('CategoriesModule');
     $this->AddModule('BookmarkedModule');
     // Render view
     $this->SetData('Title', T('My Discussions'));
     $this->SetData('Breadcrumbs', array(array('Name' => T('My Discussions'), 'Url' => '/discussions/mine')));
     $this->Render();
 }
開發者ID:3marproof,項目名稱:vanilla,代碼行數:53,代碼來源:class.discussionscontroller.php

示例15: DiscussionsController_Tagged_Create

 /**
  * Load discussions for a specific tag.
  */
 public function DiscussionsController_Tagged_Create($Sender)
 {
     Gdn_Theme::Section('DiscussionList');
     if ($Sender->Request->Get('Tag')) {
         $Tag = $Sender->Request->Get('Tag');
         $Page = GetValue('0', $Sender->RequestArgs, 'p1');
     } else {
         $Tag = urldecode(GetValue('0', $Sender->RequestArgs, ''));
         $Page = GetValue('1', $Sender->RequestArgs, 'p1');
     }
     if ($Sender->Request->Get('Page')) {
         $Page = $Sender->Request->Get('Page');
     }
     $Tag = StringEndsWith($Tag, '.rss', TRUE, TRUE);
     list($Offset, $Limit) = OffsetLimit($Page, C('Vanilla.Discussions.PerPage', 30));
     $Sender->SetData('Tag', $Tag, TRUE);
     $Sender->Title(T('Tagged with ') . htmlspecialchars($Tag));
     $Sender->Head->Title($Sender->Head->Title());
     $UrlTag = rawurlencode($Tag);
     if (urlencode($Tag) == $Tag) {
         $Sender->CanonicalUrl(Url(ConcatSep('/', "/discussions/tagged/{$UrlTag}", PageNumber($Offset, $Limit, TRUE)), TRUE));
         $FeedUrl = Url(ConcatSep('/', "/discussions/tagged/{$UrlTag}/feed.rss", PageNumber($Offset, $Limit, TRUE, FALSE)), '//');
     } else {
         $Sender->CanonicalUrl(Url(ConcatSep('/', 'discussions/tagged', PageNumber($Offset, $Limit, TRUE)) . '?Tag=' . $UrlTag, TRUE));
         $FeedUrl = Url(ConcatSep('/', 'discussions/tagged', PageNumber($Offset, $Limit, TRUE, FALSE), 'feed.rss') . '?Tag=' . $UrlTag, '//');
     }
     if ($Sender->Head) {
         $Sender->AddJsFile('discussions.js');
         $Sender->Head->AddRss($FeedUrl, $Sender->Head->Title());
     }
     if (!is_numeric($Offset) || $Offset < 0) {
         $Offset = 0;
     }
     // Add Modules
     $Sender->AddModule('NewDiscussionModule');
     $Sender->AddModule('DiscussionFilterModule');
     $BookmarkedModule = new BookmarkedModule($Sender);
     $BookmarkedModule->GetData();
     $Sender->AddModule($BookmarkedModule);
     $Sender->SetData('Category', FALSE, TRUE);
     $Sender->SetData('CountDiscussions', FALSE);
     $Sender->AnnounceData = FALSE;
     $Sender->SetData('Announcements', array(), TRUE);
     $DiscussionModel = new DiscussionModel();
     $this->_SetTagSql($DiscussionModel->SQL, $Tag, $Limit, $Offset, $Sender->Request->Get('op', 'or'));
     $Sender->DiscussionData = $DiscussionModel->Get($Offset, $Limit, array('Announce' => 'all'));
     $Sender->SetData('Discussions', $Sender->DiscussionData, TRUE);
     $Sender->SetJson('Loading', $Offset . ' to ' . $Limit);
     // Build a pager.
     $PagerFactory = new Gdn_PagerFactory();
     $Sender->Pager = $PagerFactory->GetPager('Pager', $Sender);
     $Sender->Pager->ClientID = 'Pager';
     if (urlencode($Sender->Tag) == $Sender->Tag) {
         $PageUrlFormat = "discussions/tagged/{$Sender->Tag}/{Page}";
     } else {
         $PageUrlFormat = 'discussions/tagged/{Page}?Tag=' . urlencode($Sender->Tag);
     }
     $Sender->Pager->Configure($Offset, $Limit, FALSE, $PageUrlFormat);
     // Deliver json data if necessary.
     if ($Sender->DeliveryType() != DELIVERY_TYPE_ALL) {
         $Sender->SetJson('LessRow', $Sender->Pager->ToString('less'));
         $Sender->SetJson('MoreRow', $Sender->Pager->ToString('more'));
         $Sender->View = 'discussions';
     }
     // Render the controller
     $Sender->Render('TaggedDiscussions', '', 'plugins/Tagging');
 }
開發者ID:bishopb,項目名稱:vanilla,代碼行數:70,代碼來源:class.tagging.plugin.php


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