当前位置: 首页>>代码示例>>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

 /**
  * Runs before every call to this controller.
  */
 public function initialize()
 {
     parent::initialize();
     Gdn_Theme::section('Dashboard');
     set_time_limit(0);
     // Is this even doing anything?
 }
开发者ID:sitexa,项目名称:vanilla,代码行数:10,代码来源:class.utilitycontroller.php

示例2: initialize

 /**
  * Set 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:caidongyun,项目名称:vanilla,代码行数:14,代码来源:class.routescontroller.php

示例3: initialize

 /**
  * Runs before every call to this controller.
  */
 public function initialize()
 {
     parent::initialize();
     Gdn_Theme::section('Dashboard');
     $this->Model = new DBAModel();
     $this->Form = new Gdn_Form();
     $this->addJsFile('dba.js');
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:11,代码来源: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:karanjitsingh,项目名称:iecse-forum,代码行数:63,代码来源:class.searchcontroller.php

示例5: 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.form.js');
     $this->addJsFile('jquery.popup.js');
     $this->addJsFile('jquery.gardenhandleajaxform.js');
     $this->addJsFile('global.js');
     $this->addCssFile('style.css');
     $this->addCssFile('vanillicon.css', 'static');
     parent::initialize();
     Gdn_Theme::section('Entry');
 }
开发者ID:korelstar,项目名称:vanilla,代码行数:22,代码来源:class.entrycontroller.php

示例6: 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.form.js');
     $this->addJsFile('jquery.popup.js');
     $this->addJsFile('jquery.gardenhandleajaxform.js');
     $this->addJsFile('global.js');
     $this->addCssFile('style.css');
     $this->addCssFile('vanillicon.css', 'static');
     // 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:sitexa,项目名称:vanilla,代码行数:25,代码来源:class.activitycontroller.php

示例7: 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:caidongyun,项目名称:vanilla,代码行数:27,代码来源:class.authenticationcontroller.php

示例8: Controller_Index

 /**
  * Settings screen placeholder
  *
  * @param mixed $Sender
  */
 public function Controller_Index($Sender)
 {
     Gdn_Theme::section('Moderation');
     $Sender->Permission('Garden.Settings.Manage');
     $Sender->Title('Community Reporting');
     $Sender->AddCssFile('reporting.css', 'plugins/Reporting');
     // Check to see if the admin is toggling a feature
     $Feature = GetValue('1', $Sender->RequestArgs);
     $Command = GetValue('2', $Sender->RequestArgs);
     $TransientKey = Gdn::request()->get('TransientKey');
     if (Gdn::Session()->ValidateTransientKey($TransientKey)) {
         if (in_array($Feature, array('awesome', 'report'))) {
             SaveToConfig('Plugins.Reporting.' . ucfirst($Feature) . 'Enabled', $Command == 'disable' ? FALSE : TRUE);
             Redirect('plugin/reporting');
         }
     }
     $CategoryModel = new CategoryModel();
     $Sender->SetData('Plugins.Reporting.Data', array('ReportEnabled' => $this->ReportEnabled, 'AwesomeEnabled' => $this->AwesomeEnabled));
     $Sender->Render($this->GetView('settings.php'));
 }
开发者ID:vanilla,项目名称:addons,代码行数:25,代码来源:class.reporting.plugin.php

示例9: 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->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->getByUser($Session->UserID, $Offset, $Limit);
     $CountDrafts = $this->DraftModel->getCountByUser($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:vanilla,项目名称:vanilla,代码行数:47,代码来源:class.draftscontroller.php

示例10: 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(htmlspecialchars(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);
     $this->setData('_CurrentRecords', count($ResultSet));
     $this->canonicalUrl(url('search', true));
     $this->render();
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:44,代码来源:class.searchcontroller.php

示例11: discussion

 /**
  * Create or update a discussion.
  *
  * @since 2.0.0
  * @access public
  *
  * @param int $CategoryID Unique ID of the category to add the discussion to.
  */
 public function discussion($CategoryUrlCode = '')
 {
     // Override CategoryID if categories are disabled
     $UseCategories = $this->ShowCategorySelector = (bool) c('Vanilla.Categories.Use');
     if (!$UseCategories) {
         $CategoryUrlCode = '';
     }
     // Setup head
     $this->addJsFile('jquery.autosize.min.js');
     $this->addJsFile('autosave.js');
     $this->addJsFile('post.js');
     $Session = Gdn::session();
     Gdn_Theme::section('PostDiscussion');
     // Set discussion, draft, and category data
     $DiscussionID = isset($this->Discussion) ? $this->Discussion->DiscussionID : '';
     $DraftID = isset($this->Draft) ? $this->Draft->DraftID : 0;
     $Category = false;
     $CategoryModel = new CategoryModel();
     if (isset($this->Discussion)) {
         $this->CategoryID = $this->Discussion->CategoryID;
         $Category = CategoryModel::categories($this->CategoryID);
     } elseif ($CategoryUrlCode != '') {
         $Category = CategoryModel::categories($CategoryUrlCode);
         if ($Category) {
             $this->CategoryID = val('CategoryID', $Category);
         }
     }
     if ($Category) {
         $this->Category = (object) $Category;
         $this->setData('Category', $Category);
         $this->Form->addHidden('CategoryID', $this->Category->CategoryID);
         if (val('DisplayAs', $this->Category) == 'Discussions' && !$DraftID) {
             $this->ShowCategorySelector = false;
         } else {
             // Get all our subcategories to add to the category if we are in a Header or Categories category.
             $this->Context = CategoryModel::getSubtree($this->CategoryID);
         }
     } else {
         $this->CategoryID = 0;
         $this->Category = null;
     }
     $CategoryData = $this->ShowCategorySelector ? CategoryModel::categories() : false;
     // Check permission
     if (isset($this->Discussion)) {
         // Make sure that content can (still) be edited.
         $CanEdit = DiscussionModel::canEdit($this->Discussion);
         if (!$CanEdit) {
             throw permissionException('Vanilla.Discussions.Edit');
         }
         // Make sure only moderators can edit closed things
         if ($this->Discussion->Closed) {
             $this->permission('Vanilla.Discussions.Edit', true, 'Category', $this->Category->PermissionCategoryID);
         }
         $this->Form->setFormValue('DiscussionID', $this->Discussion->DiscussionID);
         $this->title(t('Edit Discussion'));
         if ($this->Discussion->Type) {
             $this->setData('Type', $this->Discussion->Type);
         } else {
             $this->setData('Type', 'Discussion');
         }
     } else {
         // Permission to add.
         if ($this->Category) {
             $this->permission('Vanilla.Discussions.Add', true, 'Category', $this->Category->PermissionCategoryID);
         } else {
             $this->permission('Vanilla.Discussions.Add');
         }
         $this->title(t('New Discussion'));
     }
     touchValue('Type', $this->Data, 'Discussion');
     // See if we should hide the category dropdown.
     if ($this->ShowCategorySelector) {
         $AllowedCategories = CategoryModel::getByPermission('Discussions.Add', $this->Form->getValue('CategoryID', $this->CategoryID), ['Archived' => 0, 'AllowDiscussions' => 1], ['AllowedDiscussionTypes' => $this->Data['Type']]);
         if (count($AllowedCategories) == 1) {
             $AllowedCategory = array_pop($AllowedCategories);
             $this->ShowCategorySelector = false;
             $this->Form->addHidden('CategoryID', $AllowedCategory['CategoryID']);
             if ($this->Form->isPostBack() && !$this->Form->getFormValue('CategoryID')) {
                 $this->Form->setFormValue('CategoryID', $AllowedCategory['CategoryID']);
             }
         }
     }
     // Set the model on the form
     $this->Form->setModel($this->DiscussionModel);
     if (!$this->Form->isPostBack()) {
         // Prep form with current data for editing
         if (isset($this->Discussion)) {
             $this->Form->setData($this->Discussion);
         } elseif (isset($this->Draft)) {
             $this->Form->setData($this->Draft);
         } else {
             if ($this->Category !== null) {
//.........这里部分代码省略.........
开发者ID:vanilla,项目名称:vanilla,代码行数:101,代码来源:class.postcontroller.php

示例12: applicants

 /**
  * Show applicants queue.
  *
  * @since 2.0.0
  * @access public
  */
 public function applicants()
 {
     $this->permission('Garden.Users.Approve');
     $this->setHighlightRoute('dashboard/user/applicants');
     $this->addJsFile('applicants.js');
     $this->title(t('Applicants'));
     $this->fireEvent('BeforeApplicants');
     $UserModel = Gdn::userModel();
     $this->UserData = $UserModel->getApplicants();
     Gdn_Theme::section('Moderation');
     $this->render();
 }
开发者ID:vanilla,项目名称:vanilla,代码行数:18,代码来源:class.usercontroller.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->Form->InputPrefix = '';
 }
开发者ID:caidongyun,项目名称:vanilla,代码行数:14,代码来源:class.logcontroller.php

示例14: pluginController_fileUpload_create

 /**
  *
  *
  * @param PluginController $Sender
  * @throws Exception
  */
 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:vanilla,项目名称:addons,代码行数:15,代码来源:class.fileupload.plugin.php

示例15: discussionsController_Tagged_create

 /**
  * Load discussions for a specific tag.
  * @param DiscussionsController $Sender
  */
 public function discussionsController_Tagged_create($Sender)
 {
     Gdn_Theme::section('DiscussionList');
     $Args = $Sender->RequestArgs;
     $Get = array_change_key_case($Sender->Request->get());
     if ($UseCategories = c('Plugins.Tagging.UseCategories')) {
         // The url is in the form /category/tag/p1
         $CategoryCode = val(0, $Args);
         $Tag = val(1, $Args);
         $Page = val(2, $Args);
     } else {
         // The url is in the form /tag/p1
         $CategoryCode = '';
         $Tag = val(0, $Args);
         $Page = val(1, $Args);
     }
     // Look for explcit values.
     $CategoryCode = val('category', $Get, $CategoryCode);
     $Tag = val('tag', $Get, $Tag);
     $Page = val('page', $Get, $Page);
     $Category = CategoryModel::categories($CategoryCode);
     $Tag = stringEndsWith($Tag, '.rss', true, true);
     list($Offset, $Limit) = offsetLimit($Page, c('Vanilla.Discussions.PerPage', 30));
     $MultipleTags = strpos($Tag, ',') !== false;
     $Sender->setData('Tag', $Tag, true);
     $TagModel = TagModel::instance();
     $RecordCount = false;
     if (!$MultipleTags) {
         $Tags = $TagModel->getWhere(array('Name' => $Tag))->resultArray();
         if (count($Tags) == 0) {
             throw notFoundException('Page');
         }
         if (count($Tags) > 1) {
             foreach ($Tags as $TagRow) {
                 if ($TagRow['CategoryID'] == val('CategoryID', $Category)) {
                     break;
                 }
             }
         } else {
             $TagRow = array_pop($Tags);
         }
         $Tags = $TagModel->getRelatedTags($TagRow);
         $RecordCount = $TagRow['CountDiscussions'];
         $Sender->setData('CountDiscussions', $RecordCount);
         $Sender->setData('Tags', $Tags);
         $Sender->setData('Tag', $TagRow);
         $ChildTags = $TagModel->getChildTags($TagRow['TagID']);
         $Sender->setData('ChildTags', $ChildTags);
     }
     $Sender->title(htmlspecialchars($TagRow['FullName']));
     $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');
     $Sender->addModule('BookmarkedModule');
     $Sender->setData('Category', false, true);
     $Sender->AnnounceData = false;
     $Sender->setData('Announcements', array(), true);
     $DiscussionModel = new DiscussionModel();
     $TagModel->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';
     $Sender->Pager->configure($Offset, $Limit, $RecordCount, '');
     $Sender->View = c('Vanilla.Discussions.Layout');
     /*
           // If these don't equal, then there is a category that should be inserted.
           if ($UseCategories && $Category && $TagRow['FullName'] != val('Name', $Category)) {
              $Sender->Data['Breadcrumbs'][] = array('Name' => $Category['Name'], 'Url' => TagUrl($TagRow));
           }
           $Sender->Data['Breadcrumbs'][] = array('Name' => $TagRow['FullName'], 'Url' => '');
     */
     // Render the controller.
     $this->View = c('Vanilla.Discussions.Layout') == 'table' ? 'table' : 'index';
     $Sender->render($this->View, 'discussions', 'vanilla');
 }
开发者ID:caidongyun,项目名称:vanilla,代码行数:98,代码来源:class.tagging.plugin.php


注:本文中的Gdn_Theme::section方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。