本文整理汇总了PHP中Legacy_Utils类的典型用法代码示例。如果您正苦于以下问题:PHP Legacy_Utils类的具体用法?PHP Legacy_Utils怎么用?PHP Legacy_Utils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Legacy_Utils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hasPermission
/**
* hasPermission
*
* @param void
*
* @return bool
**/
public function hasPermission()
{
if ($this->mObject->isMember(Legacy_Utils::getUid(), Lenum_GroupRank::OWNER)) {
return true;
}
return false;
}
示例2: prepare
/**
* prepare
*
* @param XCube_PageNavigator &$navi
* @param XoopsObjectGenericHandler &$handler
*
* @return void
**/
public function prepare(/*** XCube_PageNavigator ***/ &$navi,/*** XoopsObjectGenericHandler ***/ &$handler)
{
$this->mFields = xoops_getmodulehandler('definitions', 'profile')->getFields4DataShow(Legacy_Utils::getUid());
$this->_addSortKeys();
parent::prepare($navi,$handler);
}
示例3: prepare
/**
* preprare
*
* @param void
*
* @return bool
**/
public function prepare()
{
$this->mPermit = Legacy_Utils::getModuleHandler('permit', $this->mAsset->mDirname)->create();
//for Permissions
$this->mPermit->set('cat_id', 0);
$this->_setupActionForm();
}
示例4: executeViewSuccess
/**
* executeViewSuccess
*
* @param XCube_RenderTarget &$render
*
* @return void
**/
public function executeViewSuccess(&$render)
{
$render->setTemplateName($this->mAsset->mDirname . '_group_view.html');
$render->setAttribute('object', $this->mObject);
$render->setAttribute('image', $this->mObject->getImage());
$render->setAttribute('dirname', $this->mAsset->mDirname);
$clientList = array();
$dataList = array('template_name' => array(), 'title' => array(), 'data' => array(), 'dirname' => array(), 'dataname' => array());
if ($this->_checkPublicity()) {
$clientList = Legroup_Utils::getClientList($this->mAsset->mDirname);
foreach ($clientList as $client) {
$dataList = $this->mObject->getClientData($dataList, $client);
}
foreach (array_keys($dataList['data']) as $key) {
$check = false;
XCube_DelegateUtils::call('Legacy_Group.' . $this->mAsset->mDirname . '.HasPermission', new XCube_Ref($check), $this->mAsset->mDirname, $this->mObject->get('group_id'), $dataList['dirname'][$key], $dataList['dataname'][$key], 'edit');
$dataList['isEditor'][$key] = $check;
unset($check);
}
}
$render->setAttribute('clientList', $clientList);
$render->setAttribute('clients', $dataList);
$render->setAttribute('isEditor', $this->mObject->isMember(Legacy_Utils::getUid(), Lenum_GroupRank::OWNER));
//breadcrumb
$breadcrumbs = array();
XCube_DelegateUtils::call('Module.' . $this->mAsset->mDirname . '.Global.Event.GetBreadcrumbs', new XCube_Ref($breadcrumbs), $this->mAsset->mDirname, $this->mObject);
$render->setAttribute('xoops_breadcrumbs', $breadcrumbs);
}
示例5: getFields4DataShow
/**
* @public
*/
public function getFields4DataShow($uid = 0)
{
$uid = $uid > 0 ? $uid : Legacy_Utils::getUid();
$lHandler =& xoops_getmodulehandler('groups_users_link', 'user');
$criteria = new CriteriaCompo();
$criteria->setSort('weight');
$fieldArr = $this->getObjects($criteria);
foreach (array_keys($fieldArr) as $keyF) {
$flag = false;
$accessArr = explode(',', $fieldArr[$keyF]->get('access'));
if ($uid === 0) {
//guest
if (in_array(XOOPS_GROUP_ANONYMOUS, $accessArr)) {
$flag = true;
}
} else {
foreach (array_keys($accessArr) as $keyA) {
if ($lHandler->isUserOfGroup($uid, $accessArr[$keyA])) {
$flag = true;
}
}
}
if (!$flag) {
unset($fieldArr[$keyF]);
}
}
return $fieldArr;
}
示例6: hasPermission
/**
* hasPermission
*
* @param void
*
* @return bool
**/
public function hasPermission()
{
$catId = $this->_getCatId();
if ($catId > 0) {
//is Manager ?
$check = $this->mAccessController['main']->check($catId, Xupdatemaster_AbstractAccessController::MANAGE, 'item');
if ($check == true) {
return true;
}
//is new post and has post permission ?
$check = $this->mAccessController['main']->check($catId, Xupdatemaster_AbstractAccessController::POST, 'item');
if ($check == true && $this->mObject->isNew()) {
return true;
}
//is old post and your post ?
if ($check == true && !$this->mObject->isNew() && $this->mObject->get('uid') == Legacy_Utils::getUid() && $this->mObject->get('uid') > 0) {
return true;
}
} else {
$idList = array();
$idList = $this->mAccessController['main']->getPermittedIdList(Xupdatemaster_AbstractAccessController::POST, $this->_getCatId());
if (count($idList) > 0 || $this->mAccessController['main']->getAccessControllerType() == 'none') {
return true;
}
}
return false;
}
示例7: prepare
/**
* prepare
*
* @param void
*
* @return bool
**/
public function prepare()
{
parent::prepare();
$topic_id = (int) $this->mRoot->mContext->mRequest->getRequest('topic_id');
$handler =& $this->mAsset->getObject('handler', 'Posts', false);
//$handler = Legacy_Utils::getModuleHandler('posts', $this->mAsset->mDirname);
$criteria = new criteriacompo();
$criteria->add(new criteria('topic_id', $topic_id));
$criteria->addSort('post_time', 'ASC');
// TODO: other sorts
$this->mPostsObj = $handler->getObjects($criteria);
if (is_object($this->mObject)) {
$this->forum_id = (int) $this->mObject->get('forum_id');
$handler = Legacy_Utils::getModuleHandler('forums', $this->mAsset->mDirname);
$this->mForumObj = $handler->get($this->forum_id);
//adump($this->mForumObj);
$this->ext_link_id = $this->mObject->get('topic_external_link_id');
//adump($external_link_id);
if ($this->ext_link_id > 0) {
$mExtHandler =& $this->mAsset->getObject('handler', 'Topics', false);
$criteria = new criteriacompo();
$criteria->add(new criteria('topic_external_link_id', $this->ext_link_id));
$this->mTopics_ExtObj = $mExtHandler->getObjects($criteria);
}
//adump($this->mTopics_ExtObj);
return true;
}
return false;
}
示例8: setupBlock
function setupBlock()
{
$showFlag = 0;
$mid = 0;
if ($this->mController->mRoot->mContext->mModule != null) {
$showFlag = preg_match("/index\\.php\$/i", xoops_getenv('PHP_SELF')) && $this->mController->mRoot->mContext->mXoopsConfig['startpage'] == $this->mController->mRoot->mContext->mXoopsModule->get('dirname');
$mid = $this->mController->mRoot->mContext->mXoopsModule->get('mid');
} else {
//
// If you does not have module_contoller, this request is to toppage or other pages of toppage.
//
// $mid = preg_match("/index\.php$/i", xoops_getenv('PHP_SELF')) ? -1 : 0;
$pathArray = parse_url(!empty($_SERVER['PATH_INFO']) ? substr($_SERVER['PHP_SELF'], 0, -strlen($_SERVER['PATH_INFO'])) : $_SERVER['PHP_SELF']);
$mid = preg_match("#(/index\\.php|/)\$#i", @$pathArray['path']) ? -1 : 0;
}
$blockHandler =& xoops_gethandler('block');
$showCenterFlag = SHOW_CENTERBLOCK_LEFT | SHOW_CENTERBLOCK_CENTER | SHOW_CENTERBLOCK_RIGHT;
$showRightFlag = SHOW_SIDEBLOCK_RIGHT;
$showFlag = SHOW_SIDEBLOCK_LEFT | $showRightFlag | $showCenterFlag;
$groups = is_object($this->mController->mRoot->mContext->mXoopsUser) ? $this->mController->mRoot->mContext->mXoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
$blockObjects =& $blockHandler->getBlocks($groups, $mid, $showFlag);
foreach ($blockObjects as $blockObject) {
$block =& Legacy_Utils::createBlockProcedure($blockObject);
if ($block->prepare() !== false) {
$this->mController->_mBlockChain[] =& $block;
}
unset($block);
unset($blockObject);
}
}
示例9: hasPermission
/**
* hasPermission
*
* @param void
*
* @return bool
**/
public function hasPermission()
{
if ($this->mObject->mLink->get('uid') != Legacy_Utils::getUid()) {
return false;
}
return $this->mRoot->mContext->mUser->isInRole('Site.RegisteredUser') ? true : false;
}
示例10: executeViewSuccess
/**
* executeViewInput
*
* @param XCube_RenderTarget &$render
*
* @return void
**/
public function executeViewSuccess(&$render)
{
$render->setTemplateName('order_show.html');
$render->setAttribute('dirname', $this->mAsset->mDirname);
$render->setAttribute('definitions', Legacy_Utils::getModuleHandler('definition', $this->mAsset->mDirname)->getFields());
$render->setAttribute('xcckConfigs', $this->mRoot->mContext->mModuleConfig);
}
示例11: loadGroup
/**
* loadGroup
*
* @param void
*
* @return void
*/
public function loadGroup()
{
if ($this->_mGroupLoadedFlag == false) {
$handler = Legacy_Utils::getModuleHandler('group', $this->getDirname());
$this->mGroup =& $handler->get($this->get('group_id'));
$this->_mGroupLoadedFlag = true;
}
}
示例12: getDataIdListByTags
/**
* getDataIdListByTags
*
* @param int[] $list
* @param string $tDirname //Legacy_Tag module's dirname
* @param string[] $tagArr
* @param string $dirname
* @param string $dataname
*/
public static function getDataIdListByTags(&$list, $tDirname, $tagArr, $dirname, $dataname)
{
if (count($tagArr) === 0) {
return;
}
$handler = Legacy_Utils::getModuleHandler('tag', $tDirname);
$list = $handler->getDataIdListByTags($tagArr, $dirname, $dataname);
}
示例13: _setupObject
/**
* _setupObject
*
* @param void
*
* @return void
**/
protected function _setupObject()
{
$id = $this->_getId();
$this->mObjectHandler =& $this->_getHandler();
$revisionHandler = Legacy_Utils::getModuleHandler('revision', $this->mAsset->mDirname);
$revision = $revisionHandler->getLatestRevision($id, Lenum_Status::REJECTED);
$this->mObject = Xcck_Utils::setupPageByRevision($revision);
}
示例14: executeViewIndex
/**
* @public
*/
function executeViewIndex(&$render)
{
$render->setTemplateName("profile_data_list.html");
$render->setAttribute('objects', $this->mObjects);
$render->setAttribute('pageNavi', $this->mFilter->mNavi);
$handler = Legacy_Utils::getModuleHandler('definitions', 'profile');
$render->setAttribute('definitions', $handler->getFields4DataShow(Legacy_Utils::getUid()));
}
示例15: executeViewInput
/**
* executeViewInput
*
* @param XCube_RenderTarget &$render
*
* @return void
**/
public function executeViewInput(&$render)
{
$render->setTemplateName($this->mAsset->mDirname . '_conv_edit.html');
$render->setAttribute('actionForm', $this->mActionForm);
$render->setAttribute('object', $this->mObject);
$render->setAttribute('Pref_idTree', $this->mCategoryManager['pref_id']->getTree(Playermap_CategoryManager::VIEW));
$myGroupIds = Legacy_Utils::getModuleHandler('member', $this->mAsset->mDirname)->getMyGroupIdList();
$render->setAttribute('myGroups', Legacy_Utils::getModuleHandler('group', $this->mAsset->mDirname)->getGroupListByIds($myGroupIds));
}