本文整理汇总了PHP中Gdn_Controller::permission方法的典型用法代码示例。如果您正苦于以下问题:PHP Gdn_Controller::permission方法的具体用法?PHP Gdn_Controller::permission怎么用?PHP Gdn_Controller::permission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdn_Controller
的用法示例。
在下文中一共展示了Gdn_Controller::permission方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: settingsController_vanillicon_create
/**
* The settings page for vanillicon.
*
* @param Gdn_Controller $sender
*/
public function settingsController_vanillicon_create($sender)
{
$sender->permission('Garden.Settings.Manage');
$cf = new ConfigurationModule($sender);
$items = array('v1' => 'Vanillicon 1', 'v2' => 'Vanillicon 2');
$cf->initialize(array('Plugins.Vanillicon.Type' => array('LabelCode' => 'Vanillicon Set', 'Control' => 'radiolist', 'Description' => 'Which vanillicon set do you want to use?', 'Items' => $items, 'Options' => array('display' => 'after'), 'Default' => 'v1')));
$sender->setData('Title', sprintf(t('%s Settings'), 'Vanillicon'));
$cf->renderAll();
}
示例2: controller_delete
/**
* Delete a Tag
*
* @param Gdn_Controller $Sender
*/
public function controller_delete($Sender)
{
$Sender->permission('Garden.Settings.Manage');
$TagID = val(1, $Sender->RequestArgs);
$TagModel = new TagModel();
$Tag = $TagModel->getID($TagID, DATASET_TYPE_ARRAY);
if ($Sender->Form->authenticatedPostBack()) {
// Delete tag & tag relations.
$SQL = Gdn::sql();
$SQL->delete('TagDiscussion', array('TagID' => $TagID));
$SQL->delete('Tag', array('TagID' => $TagID));
$Sender->informMessage(formatString(t('<b>{Name}</b> deleted.'), $Tag));
$Sender->jsonTarget("#Tag_{$Tag['TagID']}", null, 'Remove');
}
$Sender->setData('Title', t('Delete Tag'));
$Sender->render('delete', '', 'plugins/Tagging');
}
示例3: settingsController_vanillicon_create
/**
* The settings page for vanillicon.
*
* @param Gdn_Controller $sender
*/
public function settingsController_vanillicon_create($sender)
{
$sender->permission('Garden.Settings.Manage');
$cf = new ConfigurationModule($sender);
$items = array('v1' => 'Vanillicon 1', 'v2' => 'Vanillicon 2 (beta)');
$cachePath = self::getCachePath();
$writable = is_writable($cachePath);
$txtNotWritable = '<p style="color: #c00;">' . T('<b>Warning:</b> the cache directory is not writable. If you want to use the cache mechanism, you have to enable write permissions for') . '</p><code>' . $cachePath . '</code><br><br><br>';
$txtProxyActive = '<p style="color: #090;">' . T('<b>Congratulations: The privacy of your users is respected!</b> All requests to vanillicon.com are made by your server and not by your users.') . '</p><br>';
$cf->initialize(array('Plugins.Vanillicon.Type' => array('LabelCode' => 'Vanillicon Proxy', 'Control' => 'radiolist', 'Description' => $txtProxyActive . ($writable ? '' : $txtNotWritable) . ' ' . T('Which vanillicon set do you want to use?'), 'Items' => $items, 'Options' => array('list' => true, 'listclass' => 'icon-list', 'display' => 'after'), 'Default' => 'v1')));
$sender->addSideMenu();
$sender->setData('Title', sprintf(t('%s Settings'), 'Vanillicon'));
$cf->renderAll();
}