本文整理汇总了PHP中XoopsModule::loadInfoAsVar方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsModule::loadInfoAsVar方法的具体用法?PHP XoopsModule::loadInfoAsVar怎么用?PHP XoopsModule::loadInfoAsVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsModule
的用法示例。
在下文中一共展示了XoopsModule::loadInfoAsVar方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepare
function prepare(&$controller, &$xoopsUser)
{
$dirname = $controller->mRoot->mContext->mRequest->getRequest('dirname');
$handler =& xoops_gethandler('module');
$this->mXoopsModule =& $handler->getByDirname($dirname);
if (is_object($this->mXoopsModule)) {
return false;
}
$this->mXoopsModule =& $handler->create();
$this->mXoopsModule->set('weight', 1);
$this->mXoopsModule->loadInfoAsVar($dirname);
if ($this->mXoopsModule->get('dirname') == null) {
return false;
}
if ($this->mXoopsModule->get('dirname') == 'system') {
$this->mXoopsModule->set('mid', 1);
}
$this->_setupActionForm();
$this->mInstaller =& $this->_getInstaller();
//
// Set the current object.
//
$this->mInstaller->setCurrentXoopsModule($this->mXoopsModule);
return true;
}
示例2: eventCoreIncludeCommonLanguage
/**
* To prevent errors when upload images with closed site
*/
public function eventCoreIncludeCommonLanguage()
{
global $xoopsConfig;
if ($xoopsConfig['cpanel'] != 'redmexico') {
$db = XoopsDatabaseFactory::getDatabaseConnection();
$db->queryF("UPDATE " . $db->prefix("config") . " SET conf_value='redmexico' WHERE conf_modid=0 AND conf_catid=1 AND conf_name='cpanel'");
}
/**
* Check before to a rmcommon native module be installed
*/
$fct = RMHttpRequest::get('fct', 'string', '');
$op = RMHttpRequest::get('op', 'string', '');
if ('modulesadmin' == $fct && 'install' == $op) {
$dirname = RMHttpRequest::get('module', 'string', '');
if ('' != $dirname) {
$module = new XoopsModule();
$module->loadInfoAsVar($dirname);
if ($module->getInfo('rmnative')) {
RMUris::redirect_with_message(__('Please install %s using the modules manager from Common Utilities to prevent errors during install.', 'rmcommon'), RMCURL . '/modules.php?action=install&dir=' . $dirname, RMMSG_WARN);
}
}
}
if (RMUris::current_url() == RMCURL . '/include/upload.php' && $xoopsConfig['closesite']) {
$security = rmc_server_var($_POST, 'rmsecurity', 0);
$data = TextCleaner::getInstance()->decrypt($security, true);
$data = explode("|", $data);
// [0] = referer, [1] = session_id(), [2] = user, [3] = token
$xoopsUser = new XoopsUser($data[0]);
if ($xoopsUser->isAdmin()) {
$xoopsConfig['closesite'] = 0;
}
}
RMEvents::get()->run_event('rmcommon.include.common.language');
}
示例3: getVersion
/**
* Obtiene la version del mdulo actual
* Esta funci?n solo funciona con m?dulos de Red M?xico Soft
* o compatibles
* @param bool $includename Mostrar todo el nombre del m?dulo
* @param string $module Obtener Versi?n del M?dulo Espec?ficado
* @param int $type 0 = String, 1 = Array
*/
public function getVersion($includename = true, $module = '', $type = 0)
{
global $xoopsModule, $xoopsConfig;
//global $version;
if ($module != '') {
if ($xoopsModule->dirname() == $module) {
$mod = $xoopsModule;
} else {
$mod = new XoopsModule();
}
}
$mod->loadInfoAsVar($module);
$version = $mod->getInfo('rmversion');
$version = is_array($version) ? $version : array('number' => $version, 'revision' => 0, 'status' => 0, 'name' => $mod->getInfo('name'));
if ($type == 1) {
return $version;
}
$rtn = '';
if ($includename) {
$rtn .= (defined($version['name']) ? constant($version['name']) : $version['name']) . ' ';
}
$rtn .= $version['number'];
if ($version['revision'] > 0) {
$rtn .= '.' . $version['revision'] / 100;
} else {
$rtn .= '.0';
}
switch ($version['status']) {
case '-3':
$rtn .= ' alfa';
break;
case '-2':
$rtn .= ' beta';
break;
case '-1':
$rtn .= ' final';
break;
case '0':
break;
}
return $rtn;
}
示例4: get_module_version
/**
* Retrieves and format the version of a given module.
* If $module parameter is not given, then will try to get the current module version.
*
* Example with <strong>formatted</strong> result:
* <pre>
* $version = RMModules::get_module_version('mywords');
* </pre>
*
* Get the same result:
* <pre>
* $version = RMModules::get_module_version('mywords', true, 'verbose');
* </pre>
*
* Both previous examples return something like this:
* <pre>MyWords 2.1.3 production</pre>
*
* Example 2. Get an array of values:
* <pre>
* print_r(RMModules::get_module_version('mywords', true, 'raw');
* </pre>
*
* Will return:
* <pre>
* array
*
* @param string $module Module directory to check
* @param bool $name Return the name and version (true) or only version (false)
* @param string $type Type of data to get: 'verbose' get a formatted string, 'raw' gets an array with values.
* @return array|string
*/
public static function get_module_version($module = '', $name = true, $type = 'verbose')
{
global $xoopsModule;
//global $version;
if ($module != '') {
if ($xoopsModule && $xoopsModule->dirname() == $module) {
$mod = $xoopsModule;
} else {
$mod = new XoopsModule();
}
} else {
$mod = new XoopsModule();
}
$mod->loadInfoAsVar($module);
$version = $mod->getInfo('rmversion');
$version = is_array($version) ? $version : array('major' => $version, 'minor' => 0, 'revision' => 0, 'stage' => 0, 'name' => $mod->getInfo('name'));
if ($type == 'raw') {
return $version;
}
return self::format_module_version($version, $name);
}
示例5: get_available_list
/**
* Get the available widgets list
*
* @return array
*/
public static function get_available_list($mods = null)
{
$db = XoopsDatabaseFactory::getDatabaseConnection();
if ($mods == null || empty($mods)) {
$mods = RMModules::get_modules_list();
}
$list = array();
// Block list to return
foreach ($mods as $mod) {
if (!file_exists(XOOPS_ROOT_PATH . '/modules/' . $mod['dirname'] . '/xoops_version.php')) {
continue;
}
load_mod_locale($mod['dirname']);
$module = new XoopsModule();
$module->loadInfoAsVar($mod['dirname']);
$list[$mod['dirname']] = array('name' => $mod['name'], 'blocks' => $module->getInfo('blocks'));
}
// Event generated to modify the available widgets list
$list = RMEvents::get()->run_event('rmcommon.available.widgets', $list);
return $list;
}
示例6: unset
unset($libmap[$key]);
}
}
if (count($libmap) > 0) {
$libmap = getMapFingering($libmap, $module, 'xoopslib');
} else {
$libmap = array();
}
}
}
} else {
$libmap = array();
}
// Get Harvest Comparison Request on Peers API's
$mobject = new XoopsModule();
$mobject->loadInfoAsVar($module);
if ($peers = XoopsCache::read(basename(dirname(dirname(__DIR__))) . '.available.peers')) {
$uris = $peers['harvest']['modules']['uris'];
shuffle($uris);
foreach ($uris as $uri) {
$harvest[md5($uri)] = json_decode(getURIData($uri, array('module' => $module, 'modinfo' => $mobject->getInfo(), 'url' => XOOPS_URL, 'salt' => sha1(_RESOURCES_SALT_BLOWFISH), 'modmap' => $modmap, 'libmap' => 'libmap', 'mode' => 'module', 'timezone' => date_default_timezone_get(), 'microtime' => microtime(true))), true);
}
}
mkdirSecure(XOOPS_VAR_PATH . DIRECTORY_SEPARATOR . basename(__DIR__));
mkdirSecure($path = XOOPS_VAR_PATH . DIRECTORY_SEPARATOR . basename(__DIR__) . DIRECTORY_SEPARATOR . 'harvest');
if (file_exists($ffile = XOOPS_VAR_PATH . DIRECTORY_SEPARATOR . basename(__DIR__) . DIRECTORY_SEPARATOR . "harvest.json")) {
$filedata = json_decode(readRawFile($ffile), true);
} else {
$filedata = array();
}
foreach ($harvest as $key => $values) {