本文整理汇总了PHP中WT\Auth::isEditor方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth::isEditor方法的具体用法?PHP Auth::isEditor怎么用?PHP Auth::isEditor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WT\Auth
的用法示例。
在下文中一共展示了Auth::isEditor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'edit_interface.php');
require './includes/session.php';
require WT_ROOT . 'includes/functions/functions_edit.php';
$action = WT_Filter::post('action', null, WT_Filter::get('action'));
$controller = new WT_Controller_Simple();
$controller->restrictAccess(Auth::isEditor())->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();')->addInlineJavascript('
var locale_date_format="' . preg_replace('/[^DMY]/', '', str_replace(array('J', 'F'), array('D', 'M'), strtoupper($DATE_FORMAT))) . '";
');
switch ($action) {
////////////////////////////////////////////////////////////////////////////////
case 'editraw':
$xref = WT_Filter::get('xref', WT_REGEX_XREF);
$record = WT_GedcomRecord::getInstance($xref);
check_record_access($record);
$controller->setPageTitle($record->getFullName() . ' - ' . WT_I18N::translate('Edit raw GEDCOM'))->pageHeader()->addInlineJavascript('jQuery("#raw-gedcom-list").sortable({opacity: 0.7, cursor: "move", axis: "y"});');
?>
<div id="edit_interface-page">
<h4>
<?php
echo $controller->getPageTitle();
?>
示例2: define
foreach (WT_Tree::getAll() as $tree) {
$WT_TREE = $tree;
if ($WT_TREE->tree_name == $GEDCOM && ($WT_TREE->imported || Auth::isAdmin())) {
break;
}
}
// These attributes of the currently-selected tree are used frequently
if ($WT_TREE) {
define('WT_GEDCOM', $WT_TREE->tree_name);
define('WT_GED_ID', $WT_TREE->tree_id);
define('WT_GEDURL', $WT_TREE->tree_name_url);
define('WT_TREE_TITLE', $WT_TREE->tree_title_html);
define('WT_IMPORTED', $WT_TREE->imported);
define('WT_USER_GEDCOM_ADMIN', Auth::isManager($WT_TREE));
define('WT_USER_CAN_ACCEPT', Auth::isModerator($WT_TREE));
define('WT_USER_CAN_EDIT', Auth::isEditor($WT_TREE));
define('WT_USER_CAN_ACCESS', Auth::isMember($WT_TREE));
define('WT_USER_GEDCOM_ID', $WT_TREE->userPreference(WT_USER_ID, 'gedcomid'));
define('WT_USER_ROOT_ID', $WT_TREE->userPreference(WT_USER_ID, 'rootid') ? $WT_TREE->userPreference(WT_USER_ID, 'rootid') : WT_USER_GEDCOM_ID);
define('WT_USER_PATH_LENGTH', $WT_TREE->userPreference(WT_USER_ID, 'RELATIONSHIP_PATH_LENGTH'));
if (WT_USER_GEDCOM_ADMIN) {
define('WT_USER_ACCESS_LEVEL', WT_PRIV_NONE);
} elseif (WT_USER_CAN_ACCESS) {
define('WT_USER_ACCESS_LEVEL', WT_PRIV_USER);
} else {
define('WT_USER_ACCESS_LEVEL', WT_PRIV_PUBLIC);
}
load_gedcom_settings(WT_GED_ID);
} else {
define('WT_GEDCOM', '');
define('WT_GED_ID', null);
示例3:
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
use WT\Auth;
define('WT_SCRIPT_NAME', 'inverselink.php');
require './includes/session.php';
require WT_ROOT . 'includes/functions/functions_edit.php';
$controller = new WT_Controller_Simple();
$controller->restrictAccess(Auth::isEditor())->setPageTitle(WT_I18N::translate('Link to an existing media object'))->addExternalJavascript(WT_STATIC_URL . 'js/autocomplete.js')->addInlineJavascript('autocomplete();')->pageHeader();
//-- page parameters and checking
$linktoid = WT_Filter::get('linktoid', WT_REGEX_XREF);
$mediaid = WT_Filter::get('mediaid', WT_REGEX_XREF);
$linkto = WT_Filter::get('linkto', 'person|source|family|manage|repository|note');
$action = WT_Filter::get('action', 'choose|update', 'choose');
// If GedFAct_assistant/_MEDIA/ installed ======================
if ($linkto == 'manage' && array_key_exists('GEDFact_assistant', WT_Module::getActiveModules())) {
require WT_ROOT . WT_MODULES_DIR . 'GEDFact_assistant/_MEDIA/media_0_inverselink.php';
} else {
//-- check for admin
$paramok = true;
if (!empty($linktoid)) {
$paramok = WT_GedcomRecord::getInstance($linktoid)->canShow();
}
if ($action == "choose" && $paramok) {