本文整理匯總了PHP中Key::checkKey方法的典型用法代碼示例。如果您正苦於以下問題:PHP Key::checkKey方法的具體用法?PHP Key::checkKey怎麽用?PHP Key::checkKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Key
的用法示例。
在下文中一共展示了Key::checkKey方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: view
public function view()
{
$key = \Key::getCurrent();
if (!\Key::checkKey($key)) {
return;
}
$tpl = array();
$allSettings = $this->settings->getAll();
foreach ($allSettings as $key => $value) {
if ($value == 1) {
$tpl[$key] = "";
// dummy template
}
}
$content = \PHPWS_Template::process($tpl, 'addthis', 'addThis.tpl');
\Layout::add($content, 'addthis', 'DEFAULT');
}
示例2: keyDescriptions
/**
* Fills in the meta description with the current key summary.
*/
public static function keyDescriptions()
{
if (!PHPWS_Settings::get('layout', 'use_key_summaries')) {
return;
}
$key = Key::getCurrent();
if (!Key::checkKey($key, false)) {
return NULL;
}
if (!empty($key->summary)) {
$GLOBALS['Layout_Description'] =& $key->summary;
} elseif (!empty($key->title)) {
$GLOBALS['Layout_Description'] =& $key->title;
}
}
示例3: javascript
<?php
/**
* @author Matthew McNaney <mcnaney at gmail dot com>
* @version $Id$
*/
Block::show();
if (Current_User::allow('block')) {
$key = Key::getCurrent();
if (Key::checkKey($key) && javascriptEnabled()) {
javascript('jquery');
javascript('ckeditor');
$js_address = PHPWS_SOURCE_HTTP . 'mod/block/javascript/addblock/script.js';
Layout::addJSHeader('<script src="' . $js_address . '" type="text/javascript"></script>', 'addblock');
$modal = new \Modal('block-form-modal', '<div id="block-form-dialog"></div>', 'Add block here');
$modal->sizeLarge();
$save_button = '<button class="btn btn-success" id="save-block">Save</button>';
$modal->addButton($save_button);
Layout::add((string) $modal);
MiniAdmin::add('block', '<a style="cursor:pointer" data-auth-key="' . Current_User::getAuthKey() . '" data-key-id="' . $key->id . '" id="add-block"><i class="fa fa-plus"></i> Add block here</a>');
}
}
示例4: permission
public static function permission()
{
if (!isset($_REQUEST['key_id'])) {
return;
}
$key = new Key((int) $_REQUEST['key_id']);
if (!Key::checkKey($key, false)) {
return;
}
if (Current_User::isRestricted($key->module) || !$key->allowEdit()) {
Current_User::disallow();
}
// View permissions must be first to allow error checking
// Edit will add its list to the view
Users_Permission::postViewPermissions($key);
Users_Permission::postEditPermissions($key);
$result = $key->savePermissions();
if (isset($_POST['popbox'])) {
Layout::nakedDisplay(javascript('close_refresh', array('refresh' => 0)));
} else {
if (PHPWS_Error::logIfError($result)) {
$_SESSION['Permission_Message'] = dgettext('users', 'An error occurred.');
} else {
$_SESSION['Permission_Message'] = dgettext('users', 'Permissions updated.');
}
PHPWS_Core::goBack();
}
}