本文整理汇总了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();
}
}