本文整理汇总了PHP中XCube_Root类的典型用法代码示例。如果您正苦于以下问题:PHP XCube_Root类的具体用法?PHP XCube_Root怎么用?PHP XCube_Root使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XCube_Root类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetch
/**
* fetch
*
* @param void
*
* @return void
**/
public function fetch()
{
parent::fetch();
$root =& XCube_Root::getSingleton();
if (($value = $root->mContext->mRequest->getRequest('member_id')) !== null) {
$this->mNavi->addExtra('member_id', $value);
$this->_mCriteria->add(new Criteria('member_id', $value));
}
if (($value = $root->mContext->mRequest->getRequest('group_id')) !== null) {
$this->mNavi->addExtra('group_id', $value);
$this->_mCriteria->add(new Criteria('group_id', $value));
}
if (($value = $root->mContext->mRequest->getRequest('uid')) !== null) {
$this->mNavi->addExtra('uid', $value);
$this->_mCriteria->add(new Criteria('uid', $value));
}
if (($value = $root->mContext->mRequest->getRequest('status')) !== null) {
$this->mNavi->addExtra('status', $value);
$this->_mCriteria->add(new Criteria('status', $value));
}
if (($value = $root->mContext->mRequest->getRequest('since')) !== null) {
$this->mNavi->addExtra('since', $value);
$this->_mCriteria->add(new Criteria('since', $value));
}
if (($value = $root->mContext->mRequest->getRequest('rank')) !== null) {
$this->mNavi->addExtra('rank', $value);
$this->_mCriteria->add(new Criteria('rank', $value));
}
if (($value = $root->mContext->mRequest->getRequest('posttime')) !== null) {
$this->mNavi->addExtra('posttime', $value);
$this->_mCriteria->add(new Criteria('posttime', $value));
}
$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
}
示例2: fetch
/**
* fetch
*
* @param void
*
* @return void
**/
public function fetch()
{
parent::fetch();
$root =& XCube_Root::getSingleton();
if (($value = $root->mContext->mRequest->getRequest('policy_id')) !== null) {
$this->mNavi->addExtra('policy_id', $value);
$this->_mCriteria->add(new Criteria('policy_id', $value));
}
if (($value = $root->mContext->mRequest->getRequest('group_id')) !== null) {
$this->mNavi->addExtra('group_id', $value);
$this->_mCriteria->add(new Criteria('group_id', $value));
}
if (($value = $root->mContext->mRequest->getRequest('dirname')) !== null) {
$this->mNavi->addExtra('dirname', $value);
$this->_mCriteria->add(new Criteria('dirname', $value));
}
if (($value = $root->mContext->mRequest->getRequest('dataname')) !== null) {
$this->mNavi->addExtra('dataname', $value);
$this->_mCriteria->add(new Criteria('dataname', $value));
}
if (($value = $root->mContext->mRequest->getRequest('action')) !== null) {
$this->mNavi->addExtra('action', $value);
$this->_mCriteria->add(new Criteria('action', $value));
}
if (($value = $root->mContext->mRequest->getRequest('rank')) !== null) {
$this->mNavi->addExtra('rank', $value);
$this->_mCriteria->add(new Criteria('rank', $value));
}
$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
}
示例3: prepare
public function prepare()
{
$root = XCube_Root::getSingleton();
$handler = xoops_gethandler('config');
$xoopsMailerConfig = $handler->getConfigsByCat(XOOPS_CONF_MAILER);
$this->reset();
if ($xoopsMailerConfig['from'] == '') {
$this->From = $root->mContext->mXoopsConfig['adminmail'];
} else {
$this->From = $xoopsMailerConfig['from'];
}
$this->Sender = $root->mContext->mXoopsConfig['adminmail'];
$this->SetLanguage(LEGACY_MAIL_LANG, XOOPS_ROOT_PATH . '/class/mail/phpmailer/language/');
$this->CharSet = LEGACY_MAIL_CHAR;
$this->Encoding = LEGACY_MAIL_ENCO;
switch ($xoopsMailerConfig['mailmethod']) {
case 'smtpauth':
$this->IsSMTP();
$this->SMTPAuth = true;
$this->Host = implode(';', $xoopsMailerConfig['smtphost']);
$this->Username = $xoopsMailerConfig['smtpuser'];
$this->Password = $xoopsMailerConfig['smtppass'];
break;
case 'smtp':
$this->IsSMTP();
$this->SMTPAuth = false;
$this->Host = implode(';', $xoopsMailerConfig['smtphost']);
break;
case 'sendmail':
$this->IsSendmail();
$this->Sendmail = $xoopsMailerConfig['sendmailpath'];
break;
}
return true;
}
示例4: _uninstallTables
/**
* Drop table because this class is uninstaller.
*
* @protected
*/
function _uninstallTables()
{
$root =& XCube_Root::getSingleton();
$db =& $root->mController->getDB();
$dirname = $this->_mXoopsModule->get('dirname');
$t_search = array('{prefix}', '{dirname}', '{Dirname}', '{_dirname_}');
$t_replace = array(XOOPS_DB_PREFIX, strtolower($dirname), ucfirst(strtolower($dirname)), $dirname);
$tables = $this->_mXoopsModule->getInfo('tables');
if ($tables != false && is_array($tables)) {
foreach ($tables as $table) {
//
// TODO Do we need to check reserved core tables?
//
$t_tableName = $table;
if (isset($this->_mXoopsModule->modinfo['cube_style']) && $this->_mXoopsModule->modinfo['cube_style'] == true) {
$t_tableName = str_replace($t_search, $t_replace, $table);
} else {
$t_tableName = $db->prefix($table);
}
$sql = "DROP TABLE " . $t_tableName;
if ($db->query($sql)) {
$this->mLog->addReport(XCube_Utils::formatMessage(_AD_LEGACY_MESSAGE_DROP_TABLE, $t_tableName));
} else {
$this->mLog->addError(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_DROP_TABLE, $t_tableName));
}
}
}
}
示例5: smarty_function_xoops_optionsArray
function smarty_function_xoops_optionsArray($params, &$smarty)
{
//
// We should check more.
//
$tags = '';
$objectArr =& $params['from'];
$default = isset($params['default']) ? $params['default'] : null;
$id = isset($params['id']) ? XOOPS_INPUT_DEFID_PREFIX . $params['id'] . '_' : null;
static $textFilter;
if (!isset($textFilter)) {
$root =& XCube_Root::getSingleton();
$textFilter = $root->getTextFilter();
}
$vname = $params['value'];
$lname = $params['label'];
$isarr = is_array($default);
foreach ($objectArr as $object) {
$value = $object->get($vname);
$selected = $isarr ? in_array($value, $default) : $value == $default ? ' selected="selected"' : '';
$value = $textFilter->toShow($value);
$label = $textFilter->toShow($object->get($lname));
$tags .= $id ? "<option id=\"{$id}{$value}\" value=\"{$value}\"{$selected}>{$label}</option>\n" : "<option value=\"{$value}\"{$selected}>{$label}</option>\n";
}
print $tags;
}
示例6: fetch
/**
* fetch
*
* @param void
*
* @return void
**/
public function fetch()
{
parent::fetch();
$root =& XCube_Root::getSingleton();
if (($value = $root->mContext->mRequest->getRequest('group_id')) !== null) {
$this->mNavi->addExtra('group_id', $value);
$this->_mCriteria->add(new Criteria('group_id', $value));
}
if (($value = $root->mContext->mRequest->getRequest('title')) !== null) {
$this->mNavi->addExtra('title', $value);
$this->_mCriteria->add(new Criteria('title', $value));
}
if (($value = $root->mContext->mRequest->getRequest('publicity')) !== null) {
$this->mNavi->addExtra('publicity', $value);
$this->_mCriteria->add(new Criteria('publicity', $value));
}
if (($value = $root->mContext->mRequest->getRequest('approval')) !== null) {
$this->mNavi->addExtra('approval', $value);
$this->_mCriteria->add(new Criteria('approval', $value));
}
if (($value = $root->mContext->mRequest->getRequest('description')) !== null) {
$this->mNavi->addExtra('description', $value);
$this->_mCriteria->add(new Criteria('description', $value));
}
if (($value = $root->mContext->mRequest->getRequest('posttime')) !== null) {
$this->mNavi->addExtra('posttime', $value);
$this->_mCriteria->add(new Criteria('posttime', $value));
}
$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
}
示例7: fetch
function fetch()
{
parent::fetch();
$root =& XCube_Root::getSingleton();
$rank_special = $root->mContext->mRequest->getRequest('rank_special');
$option_field = $root->mContext->mRequest->getRequest('option_field');
$search = $root->mContext->mRequest->getRequest('search');
if (isset($_REQUEST['rank_special'])) {
$this->mNavi->addExtra('rank_special', xoops_getrequest('rank_special'));
$this->_mCriteria->add(new Criteria('rank_special', xoops_getrequest('rank_special')));
}
if (isset($_REQUEST['option_field'])) {
$this->mNavi->addExtra('option_field', xoops_getrequest('option_field'));
$this->mOptionField = $option_field;
if ($this->mOptionField == "special") {
//only system avatar
$this->_mCriteria->add(new Criteria('rank_special', '1'));
} elseif ($this->mOptionField == "normal") {
//only custom avatar
$this->_mCriteria->add(new Criteria('rank_special', '0'));
} else {
//all
}
}
//
if (!empty($search)) {
$this->mKeyword = $search;
$this->mNavi->addExtra('search', $this->mKeyword);
$this->_mCriteria->add(new Criteria('rank_title', '%' . $this->mKeyword . '%', 'LIKE'));
}
$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
}
示例8: smarty_function_xoops_optionsArray
function smarty_function_xoops_optionsArray($params, &$smarty)
{
//
// We should check more.
//
$tags = "";
$objectArr =& $params['from'];
$default = isset($params['default']) ? $params['default'] : null;
$id = isset($params['id']) ? $params['id'] : null;
$root =& XCube_Root::getSingleton();
$textFilter =& $root->getTextFilter();
foreach ($objectArr as $object) {
$value = $textFilter->toShow($object->get($params['value']));
$label = $textFilter->toShow($object->get($params['label']));
$selected = "";
if (is_array($default) && in_array($object->get($params['value']), $default)) {
$selected = " selected=\"selected\"";
} elseif (!is_array($default) && $object->get($params['value']) == $default) {
$selected = " selected=\"selected\"";
}
if ($id) {
$t_id = XOOPS_INPUT_DEFID_PREFIX . $id . "_" . $value;
$tags .= "<option id=\"{$t_id}\" value=\"{$value}\"{$selected}>{$label}</option>\n";
} else {
$tags .= "<option value=\"{$value}\"{$selected}>{$label}</option>\n";
}
}
print $tags;
}
示例9: getckconfig
/**
* getckconfig
*/
function getckconfig($params)
{
$mydirname = basename(dirname(dirname(__FILE__)));
$mydirPath = dirname(dirname(__FILE__));
//add ckconfig start
$ckconfig = '';
//-- set CKEdtior Option customConfig --//
$root = XCube_Root::getSingleton();
$ckconfigdirname = $root->mContext->mXoopsConfig['language'];
if (!empty($ckconfigdirname) && !file_exists($mydirPath . '/language/' . $ckconfigdirname . '/config.js')) {
$ckconfigdirname = '';
}
if (!empty($ckconfigdirname)) {
$ckconfig .= "customConfig:'" . XOOPS_MODULE_URL . "/" . $mydirname . "/language/" . $ckconfigdirname . "/config.js'";
} else {
$ckconfig .= "customConfig:''";
}
if (isset($params['toolbar'])) {
if (!empty($params['toolbar'])) {
$ckconfig .= ",toolbar:'" . $params['toolbar'] . "'";
}
}
//--------------------------------------//
//set CKEdtior Option start from second
//-- set CKEdtior Option Smailey for XoopsSmailey --//
$ckconfig .= $this->_getCkconfig4XoopsSmailey();
return $ckconfig;
//add EXTconfig end
}
示例10: checkLogin
function checkLogin(&$xoopsUser)
{
$root =& XCube_Root::getSingleton();
if ($root->mContext->mUser->isInRole('Site.RegisteredUser')) {
return;
}
$root->mLanguageManager->loadModuleMessageCatalog('user');
$userHandler =& xoops_getmodulehandler('users', 'user');
$criteria = new CriteriaCompo();
if (xoops_getrequest('uname') != "" && strpos(xoops_getrequest('uname'), '@') !== false) {
$criteria->add(new Criteria('email', xoops_getrequest('uname')));
} else {
$criteria->add(new Criteria('uname', xoops_getrequest('uname')));
// use for both e-mail or uname logiin
// $criteria->add(new Criteria('uname','')); // use for only e-mail logiin
}
$criteria->add(new Criteria('pass', md5(xoops_getrequest('pass'))));
$userArr =& $userHandler->getObjects($criteria);
if (count($userArr) != 1) {
return;
}
if ($userArr[0]->get('level') == 0) {
return;
}
$handler =& xoops_gethandler('user');
$user =& $handler->get($userArr[0]->get('uid'));
$xoopsUser = $user;
require_once XOOPS_ROOT_PATH . '/include/session.php';
xoops_session_regenerate();
$_SESSION = array();
$_SESSION['xoopsUserId'] = $xoopsUser->get('uid');
$_SESSION['xoopsUserGroups'] = $xoopsUser->getGroups();
}
示例11: 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();
}
示例12: prepare
/**
* prepare
*
* @param string $dirname
*
* @return void
**/
public static function prepare($dirname)
{
$root =& XCube_Root::getSingleton();
$instance = new Lecat_AssetPreloadBase($root->mController);
$instance->mDirname = $dirname;
$root->mController->addActionFilter($instance);
}
示例13: fetch
/**
* fetch
*
* @param void
*
* @return void
**/
public function fetch()
{
parent::fetch();
$root = XCube_Root::getSingleton();
if (($value = $root->mContext->mRequest->getRequest('definition_id')) !== null) {
$this->mNavi->addExtra('definition_id', $value);
$this->_mCriteria->add(new Criteria('definition_id', $value));
}
if (($value = $root->mContext->mRequest->getRequest('field_name')) !== null) {
$this->mNavi->addExtra('field_name', $value);
$this->_mCriteria->add(new Criteria('field_name', $value));
}
if (($value = $root->mContext->mRequest->getRequest('label')) !== null) {
$this->mNavi->addExtra('label', $value);
$this->_mCriteria->add(new Criteria('label', $value));
}
if (($value = $root->mContext->mRequest->getRequest('field_type')) !== null) {
$this->mNavi->addExtra('field_type', $value);
$this->_mCriteria->add(new Criteria('field_type', $value));
}
if (($value = $root->mContext->mRequest->getRequest('validation')) !== null) {
$this->mNavi->addExtra('validation', $value);
$this->_mCriteria->add(new Criteria('validation', $value));
}
if (($value = $root->mContext->mRequest->getRequest('required')) !== null) {
$this->mNavi->addExtra('required', $value);
$this->_mCriteria->add(new Criteria('required', $value));
}
if (($value = $root->mContext->mRequest->getRequest('weight')) !== null) {
$this->mNavi->addExtra('weight', $value);
$this->_mCriteria->add(new Criteria('weight', $value));
}
$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
}
示例14: loadRolesByModule
/**
* Loads roles of the specific module with $module, and set loaded roles to
* the current principal.
* @static
* @param XoopsModule $module
*/
function loadRolesByModule(&$module)
{
static $cache;
$root =& XCube_Root::getSingleton();
$context =& $root->mContext;
if ($module == null) {
return;
}
if (isset($cache[$module->get('mid')])) {
return;
}
$groups = is_object($context->mXoopsUser) ? $context->mXoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS);
$handler =& xoops_gethandler('groupperm');
if ($handler->checkRight('module_read', $module->get('mid'), $groups)) {
$context->mUser->addRole('Module.' . $module->get('dirname') . '.Visitor');
}
if (is_object($context->mXoopsUser) && $handler->checkRight('module_admin', $module->get('mid'), $groups)) {
$context->mUser->addRole('Module.' . $module->get('dirname') . '.Admin');
}
$handler =& xoops_getmodulehandler('group_permission', 'legacy');
$roleArr = $handler->getRolesByModule($module->get('mid'), $groups);
foreach ($roleArr as $role) {
$context->mUser->addRole('Module.' . $module->get('dirname') . '.' . $role);
}
$cache[$module->get('mid')] = true;
}
示例15: smarty_function_ck4dhtmltarea
function smarty_function_ck4dhtmltarea($params, &$smarty)
{
if (isset($params['name'])) {
$js = Ckeditor4_Utils::getJS($params);
if ($js) {
if (version_compare(LEGACY_BASE_VERSION, '2.2', '>=')) {
// Add script into HEAD
$root =& XCube_Root::getSingleton();
$jQuery = $root->mContext->getAttribute('headerScript');
$jQuery->addScript($js);
$jQuery->addLibrary('/modules/ckeditor4/ckeditor/ckeditor.js');
$addScript = '';
} else {
$xoopsURL = XOOPS_URL;
$addScript = <<<EOD
<script type="text/javascript">
if (typeof jQuery != 'undefined') {
\tjQuery(function(\$){
\t\t{$js}
\t});
}
</script>
<script type="text/javascript" src="{$xoopsURL}/modules/ckeditor4/ckeditor/ckeditor.js"></script>
EOD;
//$smarty->assign( 'xoops_module_header', $smarty->get_template_vars( 'xoops_module_header' ) . $addScript );
}
}
//
// Build the object for output.
//
print '<textarea name="' . $params['name'] . '" class="' . $params['class'] . '" style="' . $params['style'] . '" cols="' . $params['cols'] . '" rows="' . $params['rows'] . '" id="' . $params['id'] . '">' . $params['value'] . '</textarea>' . $addScript;
}
}