本文整理汇总了PHP中XCube_DelegateUtils类的典型用法代码示例。如果您正苦于以下问题:PHP XCube_DelegateUtils类的具体用法?PHP XCube_DelegateUtils怎么用?PHP XCube_DelegateUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XCube_DelegateUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_legacy_tag_select
function smarty_function_legacy_tag_select($params, &$smarty)
{
$tDirname = $params['tDirname'];
$dirname = isset($params['dirname']) ? $params['dirname'] : null;
$dataname = isset($params['dataname']) ? $params['dataname'] : null;
$uidList = isset($params['uidList']) ? $params['uidList'] : null;
$tags = isset($params['tags']) ? $params['tags'] : null; //selected tags
$template = isset($params['template']) ? $params['template'] : 'legacy_inc_tag_select.html';
$cloud = array();
XCube_DelegateUtils::call('Legacy_Tag.'.$tDirname.'.GetTagCloudSrc',
new XCube_Ref($cloud),
$tDirname,
$dirname,
$dataname,
$uidList
);
//render template
$render = new XCube_RenderTarget();
$render->setTemplateName($template);
$render->setAttribute('legacy_buffertype',XCUBE_RENDER_TARGET_TYPE_MAIN);
$render->setAttribute('cloud', $cloud);
$render->setAttribute('tags', $tags);
XCube_Root::getSingleton()->getRenderSystem('Legacy_RenderSystem')->render($render);
echo $render->getResult();
}
示例2: getDefaultView
function getDefaultView(&$controller, &$xoopsUser)
{
if (!isset($_REQUEST['actkey']) || !$this->mObject) {
$controller->executeForward(XOOPS_URL . '/');
}
if ($this->mObject->get('actkey') != xoops_getrequest('actkey')) {
$controller->executeRedirect(XOOPS_URL . '/', 3, _MD_USER_MESSAGE_ACTKEYNOT);
}
if ($this->mObject->get('level') > 0) {
$controller->executeRedirect(XOOPS_URL . '/user.php', 3, _MD_USER_MESSAGE_ACONTACT);
}
$this->mObject->set('level', '1');
//
// Force update with GET request
//
$this->mObjectHandler->insert($this->mObject, true);
if ($this->mConfig['activation_type'] == 2) {
$builder = new User_RegistAdminCommitMailBuilder();
$director = new User_UserRegistMailDirector($builder, $this->mObject, $controller->mRoot->mContext->getXoopsConfig(), $this->mConfig);
$director->contruct();
$mailer =& $builder->getResult();
XCube_DelegateUtils::call('Legacy.Event.RegistUser.SendMail', new XCube_Ref($mailer), 'Activated');
if ($mailer->send()) {
$controller->executeRedirect(XOOPS_URL . '/', 5, sprintf(_MD_USER_MESSAGE_ACTVMAILOK, $this->mObject->get('uname')));
} else {
$controller->executeRedirect(XOOPS_URL . '/', 5, sprintf(_MD_USER_MESSAGE_ACTVMAILNG, $this->mObject->get('uname')));
}
} else {
$controller->executeRedirect(XOOPS_URL . '/user.php', 5, _MD_USER_MESSAGE_ACTLOGIN);
}
}
示例3: resign
function resign(&$flag, &$controller, &$xoopsUser)
{
$handler =& xoops_gethandler('member');
$groups = $handler->getGroupsByUser($xoopsUser->get('uid'));
foreach ($groups as $group) {
$handler->removeUserFromGroup($group, $xoopsUser->get('uid'));
}
$handler->addUserToGroup(RESIGN_USER_GROUP_ID, $xoopsUser->get('uid'));
xoops_notification_deletebyuser($xoopsUser->get('uid'));
XCube_DelegateUtils::call('Legacy.Event.UserDelete', new XCube_Ref($xoopsUser));
$flag = true;
$root =& XCube_Root::getSingleton();
// Reset session
$_SESSION = array();
$root->mSession->destroy(true);
// reset online
$handler =& xoops_gethandler('online');
$handler->destroy($xoopsUser->get('uid'));
xoops_notification_deletebyuser($xoopsUser->get('uid'));
// Redirect not to call behind delegates.
$langMgr =& $root->getLanguageManager();
$langMgr->loadPageTypeMessageCatalog('user');
$controller =& $root->getController();
$controller->executeRedirect(XOOPS_URL, 3, _US_BEENDELED);
}
示例4: smarty_function_legacy_comment
function smarty_function_legacy_comment($params, &$smarty)
{
$cDirname = $params['cDirname'];
$dirname = isset($params['dirname']) ? $params['dirname'] : null;
$dataname = isset($params['dataname']) ? $params['dataname'] : null;
$dataId = isset($params['data_id']) ? $params['data_id'] : 0;
$categoryId = isset($params['category_id']) ? $params['category_id'] : 0;
$comments = null;
XCube_DelegateUtils::call('Legacy_Comment.'.$cDirname.'.GetComments',
new XCube_Ref($comments),
$cDirname,
$dirname,
$dataname,
$dataId,
$categoryId,
$params
);
$template = isset($params['template']) ? $params['template'] : $comments['template'];
//render template
$render = new XCube_RenderTarget();
$render->setTemplateName($template);
$render->setAttribute('legacy_buffertype',XCUBE_RENDER_TARGET_TYPE_MAIN);
$render->setAttribute('comments', $comments);
XCube_Root::getSingleton()->getRenderSystem('Legacy_RenderSystem')->render($render);
echo $render->getResult();
}
示例5: smarty_function_legacy_map_edit
function smarty_function_legacy_map_edit($params, &$smarty)
{
$dirname = isset($params['dirname']) ? $params['dirname'] : null;
$dataname = isset($params['dataname']) ? $params['dataname'] : null;
$dataId = isset($params['data_id']) ? $params['data_id'] : null;
$addressId = isset($params['geocode']) ? $params['geocode'] : null;
$template = isset($params['template']) ? $params['template'] : 'legacy_inc_map_edit.html';
$places = array();
XCube_DelegateUtils::call('Legacy_Map.GetPlaces', new XCube_Ref($places), $dirname, $dataname, $dataId);
$root = XCube_Root::getSingleton();
$latitude = $root->mContext->mRequest->getRequest('latitude');
$longitude = $root->mContext->mRequest->getRequest('longitude');
$request = null;
if (isset($latitude) && isset($longitude)) {
$request = array('latitude' => $latitude, 'longitude' => $longitude, 'zoom' => 10);
}
//render template
$render = new XCube_RenderTarget();
$render->setTemplateName($template);
$render->setAttribute('legacy_buffertype', XCUBE_RENDER_TARGET_TYPE_MAIN);
$render->setAttribute('places', $places);
$render->setAttribute('geocode', $geocode);
$render->setAttribute('request', $request);
XCube_Root::getSingleton()->getRenderSystem('Legacy_RenderSystem')->render($render);
echo $render->getResult();
}
示例6: execute
function execute(&$controller, &$xoopsUser)
{
if (XCube_Root::getSingleton()->mContext->mRequest->getRequest('_form_control_cancel') != null) {
return USER_FRAME_VIEW_CANCEL;
}
$memberHandler =& xoops_gethandler('member');
$this->mNewUser =& $memberHandler->createUser();
$this->mRegistForm->update($this->mNewUser);
$this->mNewUser->set('uorder', $controller->mRoot->mContext->getXoopsConfig('com_order'), true);
$this->mNewUser->set('umode', $controller->mRoot->mContext->getXoopsConfig('com_mode'), true);
if ($this->mConfig['activation_type'] == 1) {
$this->mNewUser->set('level', 1, true);
}
if (!$memberHandler->insertUser($this->mNewUser)) {
$this->mRedirectMessage = _MD_USER_LANG_REGISTERNG;
return USER_FRAME_VIEW_ERROR;
}
if (!$memberHandler->addUserToGroup(XOOPS_GROUP_USERS, $this->mNewUser->get('uid'))) {
$this->mRedirectMessage = _MD_USER_LANG_REGISTERNG;
return USER_FRAME_VIEW_ERROR;
}
$this->_clearRegistForm($controller);
$this->_processMail($controller);
$this->_eventNotifyMail($controller);
XCube_DelegateUtils::call('Legacy.Event.RegistUser.Success', new XCube_Ref($this->mNewUser));
return USER_FRAME_VIEW_SUCCESS;
}
示例7: smarty_function_legacy_tag_cloud
function smarty_function_legacy_tag_cloud($params, &$smarty)
{
$tDirname = $params['tDirname'];
$dirname = isset($params['dirname']) ? $params['dirname'] : null;
$dataname = isset($params['dataname']) ? $params['dataname'] : null;
$uidList = isset($params['uidList']) ? $params['uidList'] : null;
$max = isset($params['max']) ? $params['max'] : 200; //font size(%)
$min = isset($params['min']) ? $params['min'] : 80; //font size(%)
$template = isset($params['template']) ? $params['template'] : 'legacy_inc_tag_cloud.html';
$cloud = array();
XCube_DelegateUtils::call('Legacy_Tag.'.$tDirname.'.GetTagCloudSrc',
new XCube_Ref($cloud),
$tDirname,
$dirname,
$dataname,
$uidList
);
$sizeArr = _smarty_function_legacy_tag_cloud_get_size($cloud, $max, $min);
//render template
$render = new XCube_RenderTarget();
$render->setTemplateName($template);
$render->setAttribute('legacy_buffertype',XCUBE_RENDER_TARGET_TYPE_MAIN);
$render->setAttribute('dirname', $tDirname);
$render->setAttribute('cloud', $cloud);
$render->setAttribute('sizeArr', $sizeArr);
XCube_Root::getSingleton()->getRenderSystem('Legacy_RenderSystem')->render($render);
echo $render->getResult();
}
示例8: b_legacy_waiting_show
function b_legacy_waiting_show()
{
$modules = array();
XCube_DelegateUtils::call('Legacyblock.Waiting.Show', new XCube_Ref($modules));
$block['modules'] = $modules;
return $block;
}
示例9: XCube_Ref
/**
* &getPlayermapHandler
*
* @param string $name
* @param string $dirname
*
* @return XoopsObjectHandleer
**/
public static function &getPlayermapHandler($name, $dirname)
{
$asset = null;
XCube_DelegateUtils::call('Module.playermap.Global.Event.GetAssetManager', new XCube_Ref($asset), $dirname);
if (is_object($asset) && is_a($asset, 'Playermap_AssetManager')) {
return $asset->getObject('handler', $name);
}
}
示例10: getTemplateName
function getTemplateName()
{
$template_name = $this->template_name;
// calling a delegate for replacing the main template
if (class_exists('XCube_DelegateUtils')) {
XCube_DelegateUtils::raiseEvent('ModuleClass.Pico.Controller.GetTemplateName', $this->mydirname, new XCube_Ref($template_name));
}
return $template_name;
}
示例11: execute
function execute($request)
{
// Ticket Check
if (!$GLOBALS['xoopsGTicket']->check(true, 'pico')) {
redirect_header(XOOPS_URL . '/', 3, $GLOBALS['xoopsGTicket']->getErrors());
}
parent::execute($request);
// initialize
$cat_data = $this->currentCategoryObj->getData();
$picoPermission =& PicoPermission::getInstance();
// permission check
if (empty($cat_data['can_post'])) {
redirect_header(XOOPS_URL . '/', 2, _MD_PICO_ERR_MAKECONTENT);
}
// insert a content
$content_id = pico_makecontent($this->mydirname);
$content_uri4html = XOOPS_URL . "/modules/{$this->mydirname}/" . pico_common_make_content_link4html($this->mod_config, $content_id, $this->mydirname);
// get contentObj
$this->contentObj =& new PicoContent($this->mydirname, $content_id, $this->currentCategoryObj);
$content_data = $this->contentObj->getData();
// return uri
if (!empty($_GET['ret']) && ($ret_uri = pico_main_parse_ret2uri($this->mydirname, $_GET['ret']))) {
$ret_uri4html = htmlspecialchars($ret_uri, ENT_QUOTES);
} else {
$ret_uri4html = $content_uri4html;
}
// calling a delegate
if (class_exists('XCube_DelegateUtils')) {
XCube_DelegateUtils::raiseEvent('ModuleClass.Pico.Contentman.InsertSuccess', $this->mydirname, $content_id, $cat_data, $ret_uri4html);
}
// create extra_tags for notifications
$extra_tags = array('CONTENT_URL' => pico_common_unhtmlspecialchars($content_uri4html), 'APPROVAL_URL' => XOOPS_URL . "/modules/{$this->mydirname}/index.php?page=contentmanager&content_id={$content_id}", 'CAT_TITLE' => $cat_data['cat_title'], 'CONTENT_SUBJECT' => $content_data['subject_raw']);
// users2notify (can_readfull only)
$users2notify = $picoPermission->getUidsFromCatid($this->mydirname, $cat_data['id'], 'can_readfull');
if ($cat_data['post_auto_approved']) {
// Notify for new content 'global'
pico_main_trigger_event($this->mydirname, 'global', 0, 'newcontent', $extra_tags, $users2notify, 0);
// Notify for new content 'category' of all parental categories
foreach (array_keys($cat_data['paths_raw']) as $cat_id) {
pico_main_trigger_event($this->mydirname, 'category', $cat_id, 'newcontent', $extra_tags, $users2notify, 0);
}
// message "registered"
redirect_header($ret_uri4html, 2, _MD_PICO_MSG_CONTENTMADE);
} else {
// Notify for new waiting content (only for admin or mod)
$users2notify = pico_main_get_moderators($this->mydirname, $cat_data['id']);
if (empty($users2notify)) {
$users2notify = array(0);
}
pico_main_trigger_event($this->mydirname, 'global', 0, 'waitingcontent', $extra_tags, $users2notify);
// message "waiting approval"
redirect_header($ret_uri4html, 2, _MD_PICO_MSG_CONTENTWAITINGREGISTER);
}
// view
$this->is_need_header_footer = false;
}
示例12: executeViewInput
/**
* executeViewInput
*
* @param XCube_RenderTarget &$render
*
* @return void
**/
public function executeViewInput(&$render)
{
$render->setTemplateName($this->mAsset->mDirname . '_group_delete.html');
$render->setAttribute('actionForm', $this->mActionForm);
$render->setAttribute('object', $this->mObject);
//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);
}
示例13: getClientList
/**
* getClientList
*
* @param string $dirname
*
* @return array
**/
public static function getClientList($dirname)
{
$clients = array();
$list = array();
XCube_DelegateUtils::call('Legacy_GroupClient.GetClientList', new XCube_Ref($clients), $dirname);
foreach ($clients as $module) {
$list[] = array('dirname' => trim($module['dirname']), 'dataname' => trim($module['dataname']), 'fieldname' => trim($module['fieldname']));
}
return $list;
}
示例14: addOGPTagsToTheme
/**
* Add OGP tags to theme
* @param Legacy_XoopsTpl $xoopsTpl
* @return void
*/
public function addOGPTagsToTheme(Legacy_XoopsTpl $xoopsTpl)
{
if ($this->_isBeginRenderTheme() === false) {
return;
}
$ogpData = array();
XCube_DelegateUtils::raiseEvent('OGP.SetUp', new XCube_Ref($ogpData), new XCube_Ref($xoopsTpl));
$ogpTags = $this->_renderOGPTags($ogpData);
$this->_prependToXoopsModuleHeader($xoopsTpl, $ogpTags);
}
示例15: _getProfile
/**
* @param string $key
* @return mixed
*/
protected function _getProfile($key)
{
if ($this->profile === null) {
XCube_DelegateUtils::call('Legacy_Profile.GetProfile', new XCube_Ref($this->profile), $this->get('uid'));
}
if ($this->profile instanceof XoopsSimpleObject) {
return $this->profile->get($key);
}
return null;
}