本文整理汇总了PHP中Gdn_Controller::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP Gdn_Controller::initialize方法的具体用法?PHP Gdn_Controller::initialize怎么用?PHP Gdn_Controller::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdn_Controller
的用法示例。
在下文中一共展示了Gdn_Controller::initialize方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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.form.js');
$this->addJsFile('jquery.popup.js');
$this->addJsFile('jquery.gardenhandleajaxform.js');
$this->addJsFile('jquery.autosize.min.js');
$this->addJsFile('global.js');
$this->addCssFile('style.css');
$this->addCssFile('vanillicon.css', 'static');
$this->addModule('GuestModule');
parent::initialize();
Gdn_Theme::section('Profile');
if ($this->EditMode) {
$this->CssClass .= 'EditMode';
}
/**
* The default Cache-Control header does not include no-store, which can cause issues with outdated session
* information (e.g. message button missing). The same check is performed here as in Gdn_Controller before the
* Cache-Control header is added, but this value includes the no-store specifier.
*/
if (Gdn::session()->isValid()) {
$this->setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
}
$this->setData('Breadcrumbs', array());
$this->CanEditPhotos = Gdn::session()->checkRankedPermission(c('Garden.Profile.EditPhotos', true)) || Gdn::session()->checkPermission('Garden.Users.Edit');
}
示例2: initialize
/**
* Before every controller method call.
*/
public function initialize()
{
if ($this->deliveryType() == DELIVERY_TYPE_ALL) {
$this->Head = new HeadModule($this);
}
$this->addCssFile('style.css');
parent::initialize();
}
示例3: initialize
/**
* Do this before anything else.
*/
public function initialize()
{
parent::initialize();
if ($this->deliveryType() == DELIVERY_TYPE_ALL) {
$this->Head = new HeadModule($this);
}
$this->addCssFile('style.css');
$this->addCssFile('addons.css');
$this->CountCommentsPerPage = c('Vanilla.Comments.PerPage', 30);
}
示例4: initialize
/**
* Before all method calls.
*/
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('admin.css');
$this->MasterView = 'admin';
parent::initialize();
}
示例5: initialize
/**
* CSS, JS and module includes.
*/
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');
$this->addModule('GuestModule');
parent::initialize();
}
示例6: 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');
}
示例7: initialize
/**
* Add JS, CSS, modules. Automatically run on every use.
*
* @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('jquery.expander.js');
$this->addJsFile('global.js');
$this->addCssFile('style.css');
$this->addCssFile('vanillicon.css', 'static');
$this->addCssFile('menu.css');
$this->addModule('GuestModule');
parent::initialize();
$this->setData('Breadcrumbs', array(array('Name' => t('Search'), 'Url' => '/search')));
}
示例8: 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')));
}
示例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()
{
// Set up head
$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('jquery.atwho.js');
$this->addJsFile('global.js');
$this->addCssFile('style.css');
$this->addCssFile('vanillicon.css', 'static');
// Add modules
// $this->addModule('MeModule');
$this->addModule('GuestModule');
$this->addModule('SignedInModule');
parent::initialize();
}
示例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.form.js');
$this->addJsFile('jquery.popup.js');
$this->addJsFile('jquery.gardenhandleajaxform.js');
$this->addJsFile('jquery.autosize.min.js');
$this->addJsFile('global.js');
$this->addCssFile('style.css');
$this->addCssFile('vanillicon.css', 'static');
$this->addModule('GuestModule');
parent::initialize();
Gdn_Theme::section('Profile');
if ($this->EditMode) {
$this->CssClass .= 'EditMode';
}
$this->setData('Breadcrumbs', array());
$this->CanEditPhotos = c('Garden.Profile.EditPhotos') || Gdn::session()->checkPermission('Garden.Users.Edit');
}
示例11: 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()
{
// You've got to be signed in to send private messages.
if (!Gdn::session()->isValid()) {
redirect('/entry/signin?Target=' . urlencode($this->SelfUrl));
}
if ($this->deliveryType() == DELIVERY_TYPE_ALL) {
$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('jquery.autosize.min.js');
$this->addJsFile('jquery.tokeninput.js');
$this->addJsFile('global.js');
$this->addJsFile('conversations.js');
}
$this->addCssFile('style.css');
$this->addCssFile('vanillicon.css', 'static');
parent::initialize();
}
示例12: 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('magnific-popup.min.js');
$this->addJsFile('jquery.autosize.min.js');
$this->addJsFile('global.js');
if (in_array($this->ControllerName, array('profilecontroller', 'activitycontroller'))) {
$this->addCssFile('style.css');
$this->addCssFile('vanillicon.css', 'static');
} else {
if (!c('Garden.Cdns.Disable', false)) {
$this->addCssFile('https://fonts.googleapis.com/css?family=Rokkitt');
}
$this->addCssFile('admin.css');
$this->addCssFile('magnific-popup.css');
}
$this->MasterView = 'admin';
parent::initialize();
}
示例13: initialize
/**
* Switch MasterView. Include JS, CSS used by all methods.
*
* Always called by dispatcher before controller's requested method.
*
* @since 2.0.0
* @access public
*/
public function initialize()
{
// Set up head
$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('jquery.atwho.js');
$this->addJsFile('jquery.autosize.min.js');
$this->addJsFile('global.js');
if (in_array($this->ControllerName, array('profilecontroller', 'activitycontroller'))) {
$this->addCssFile('style.css');
$this->addCssFile('vanillicon.css', 'static');
} else {
$this->addCssFile('admin.css');
}
// Change master template
$this->MasterView = 'admin';
parent::initialize();
Gdn_Theme::section('Dashboard');
}