本文整理汇总了PHP中Legacy_Utils类的典型用法代码示例。如果您正苦于以下问题:PHP Legacy_Utils类的具体用法?PHP Legacy_Utils怎么用?PHP Legacy_Utils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Legacy_Utils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:mambax7,项目名称:legroup,代码行数:14,代码来源:_PolicyDeleteAction.class.php
示例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);
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:15,代码来源:DataFilterForm.class.php
示例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();
}
开发者ID:hiro1173,项目名称:legacy,代码行数:14,代码来源:DefaultSetAction.class.php
示例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);
}
开发者ID:mambax7,项目名称:legroup,代码行数:35,代码来源:GroupViewAction.class.php
示例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;
}
开发者ID:hiro1173,项目名称:legacy,代码行数:31,代码来源:Definitions.class.php
示例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;
}
开发者ID:nao-pon,项目名称:xupdate_master,代码行数:34,代码来源:ItemEditAction.class.php
示例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;
}
开发者ID:naao,项目名称:xcforum_proto,代码行数:36,代码来源:TopicsViewAction.class.php
示例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);
}
}
开发者ID:nouphet,项目名称:rata,代码行数:30,代码来源:Legacy_PublicControllerStrategy.class.php
示例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;
}
开发者ID:kilica,项目名称:playermap,代码行数:14,代码来源:UpdateEditAction.class.php
示例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);
}
开发者ID:mambax7,项目名称:xcck,代码行数:14,代码来源:OrderShowAction.class.php
示例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;
}
}
开发者ID:mambax7,项目名称:legroup,代码行数:15,代码来源:Policy.class.php
示例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);
}
开发者ID:mambax7,项目名称:letag,代码行数:17,代码来源:TagDelegateFunctions.class.php
示例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);
}
开发者ID:mambax7,项目名称:xcck,代码行数:15,代码来源:RevisionViewAction.class.php
示例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()));
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:11,代码来源:DataListAction.class.php
示例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));
}
开发者ID:kilica,项目名称:playermap,代码行数:16,代码来源:ConvEditAction.class.php
示例16: getImageObjects
/**
* getImageObjects
*
* @param Legacy_AbstractImageObject[] &$objects
* @param string $dirname
* @param string $dataname
* @param int $dataId
* @param int $num
* @param int $limit
* @param int $start
*
* @return void
*/
public static function getImageObjects(&$objects, $dirname, $dataname, $dataId = 0, $num = 0, $limit = 10, $start = 0)
{
XCube_Root::getSingleton()->mLanguageManager->loadModuleMessageCatalog(LEGACY_IMAGE_DIRNAME);
$handler = Legacy_Utils::getModuleHandler('image', LEGACY_IMAGE_DIRNAME);
$images = $handler->getImageObjects($dirname, $dataname, $dataId, $num, $limit, $start);
foreach ($images as $image) {
$objects[$image->getShow('num')] = $image;
}
}
开发者ID:mambax7,项目名称:leimg,代码行数:22,代码来源:ImageDelegateFunctions.class.php
示例17: execute
function execute()
{
$root =& XCube_Root::getSingleton();
// load message catalog of legacy for _AD_LEGACY_LANG_NO_SETTING, even if the current module is not Legacy.
$root->mLanguageManager->loadModuleAdminMessageCatalog('legacy');
//
$root->mLanguageManager->loadModinfoMessageCatalog('legacy');
$controller =& $root->mController;
$user =& $root->mController->mRoot->mContext->mXoopsUser;
$render =& $this->getRenderTarget();
$render->setAttribute('legacy_module', 'legacy');
$this->mCurrentModule =& $controller->mRoot->mContext->mXoopsModule;
if ($this->mCurrentModule->get('dirname') == 'legacy') {
if (xoops_getrequest('action') == "help") {
$moduleHandler =& xoops_gethandler('module');
$t_module =& $moduleHandler->getByDirname(xoops_gethandler('dirname'));
if (is_object($t_module)) {
$this->mCurrentModule =& $t_module;
}
}
}
$db =& $controller->getDB();
$mod = $db->prefix("modules");
$perm = $db->prefix("group_permission");
$groups = implode(",", $user->getGroups());
//
// Users who are belong to ADMIN GROUP have every permissions, so we have to prepare two kinds of SQL.
//
if ($root->mContext->mUser->isInRole('Site.Owner')) {
$sql = "SELECT DISTINCT mid FROM {$mod} WHERE isactive=1 AND hasadmin=1 ORDER BY weight, mid";
} else {
$sql = "SELECT DISTINCT {$mod}.mid FROM {$mod},{$perm} " . "WHERE {$mod}.isactive=1 AND {$mod}.mid={$perm}.gperm_itemid AND {$perm}.gperm_name='module_admin' AND {$perm}.gperm_groupid IN ({$groups}) " . "AND {$mod}.hasadmin=1 " . "ORDER BY {$mod}.weight, {$mod}.mid";
}
$result = $db->query($sql);
$handler =& xoops_gethandler('module');
while ($row = $db->fetchArray($result)) {
$xoopsModule =& $handler->get($row['mid']);
$module =& Legacy_Utils::createModule($xoopsModule);
$this->mModules[] =& $module;
unset($module);
}
//
$tpl = $db->prefix("tplfile");
$tpl_modules = array();
$sql = "SELECT DISTINCT tpl_module FROM {$tpl}";
$result = $db->query($sql);
while ($row = $db->fetchArray($result)) {
$tpl_modules[] = $row['tpl_module'];
}
$render->setAttribute('tplmodules', $tpl_modules);
//
$render->setTemplateName('legacy_admin_block_sidemenu.html');
$render->setAttribute('modules', $this->mModules);
$render->setAttribute('currentModule', $this->mCurrentModule);
$renderSystem =& $root->getRenderSystem($this->getRenderSystemName());
$renderSystem->renderBlock($render);
}
开发者ID:nouphet,项目名称:rata,代码行数:57,代码来源:AdminSideMenu.class.php
示例18: Profile_DataObject
/**
* @public
*/
public function Profile_DataObject()
{
$handler = Legacy_Utils::getModuleHandler('definitions', 'profile');
$this->mDef = $handler->getDefinitions(false);
$this->initVar('uid', XOBJ_DTYPE_INT, '', false);
foreach (array_keys($this->mDef) as $key) {
$this->mDef[$key]->mFieldType->setInitVar($this, $this->mDef[$key]->getShow('field_name'), $this->mDef[$key]->getDefault());
}
}
开发者ID:hiro1173,项目名称:legacy,代码行数:12,代码来源:Data.class.php
示例19: createBlogModule
/**
* @public
*/
public function createBlogModule(&$module, &$log)
{
$handler = Legacy_Utils::getModuleHandler('definition', $dirname);
$arr = self::_getFieldSetting();
foreach ($arr as $field) {
$obj = $handler->create();
self::_setupObject($obj, $field);
$handler->insert($obj, true);
}
}
开发者ID:mambax7,项目名称:xcck,代码行数:13,代码来源:CreateBlogModule.class.php
示例20: getClientModules
/**
* getClientModules
*
* @param mixed[] &$list
*
* @return void
*/
public function getClientModules(&$list)
{
$dirnames = Legacy_Utils::getDirnameListByTrustDirname(basename(dirname(dirname(__FILE__))));
foreach ($dirnames as $dirname) {
$list[] = array('dirname' => $dirname, 'dataname' => 'rpg');
}
foreach ($dirnames as $dirname) {
$list[] = array('dirname' => $dirname, 'dataname' => 'book');
}
}
开发者ID:kilica,项目名称:playermap,代码行数:17,代码来源:DelegateFunctions.class.php
注:本文中的Legacy_Utils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论