当前位置: 首页>>代码示例>>PHP>>正文


PHP XoopsModule::getInfo方法代码示例

本文整理汇总了PHP中XoopsModule::getInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsModule::getInfo方法的具体用法?PHP XoopsModule::getInfo怎么用?PHP XoopsModule::getInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XoopsModule的用法示例。


在下文中一共展示了XoopsModule::getInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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');
 }
开发者ID:txmodxoops,项目名称:rmcommon,代码行数:37,代码来源:core.php

示例2: getModule

 /**
  * getModule
  * 
  * @param	Legacy_AbstractModule  &$obj
  * @param	XoopsModule  $module
  * 
  * @return	void
  **/
 public static function getModule(&$obj, $module)
 {
     if ($module->getInfo('trust_dirname') == 'lecat') {
         require_once LECAT_TRUST_PATH . '/class/Module.class.php';
         $obj = new Lecat_Module($module);
     }
 }
开发者ID:nouphet,项目名称:rata,代码行数:15,代码来源:AssetPreload.class.php

示例3: getModule

 /**
  * getModule
  *
  * @param   Legacy_AbstractModule  &$obj
  * @param   XoopsModule  $module
  *
  * @return  void
  **/
 public static function getModule(&$obj, $module)
 {
     if ($module->getInfo('trust_dirname') == 'xupdate') {
         require_once XUPDATE_TRUST_PATH . '/class/Module.class.php';
         $obj = new Xupdate_Module($module);
     }
 }
开发者ID:nao-pon,项目名称:xupdate,代码行数:15,代码来源:AssetPreload.class.php

示例4: getModule

 /**
  * getModule
  * 
  * @param	Legacy_AbstractModule  &$obj
  * @param	XoopsModule  $module
  * 
  * @return	void
  **/
 public static function getModule(&$obj, $module)
 {
     if ($module->getInfo('trust_dirname') == 'playermap') {
         require_once PLAYERMAP_TRUST_PATH . '/class/Module.class.php';
         $obj = new Playermap_Module($module);
     }
 }
开发者ID:kilica,项目名称:playermap,代码行数:15,代码来源:AssetPreload.class.php

示例5: getModule

 /**
  * getModule
  * 
  * @param	Legacy_AbstractModule  &$obj
  * @param	XoopsModule  $module
  * 
  * @return	void
  **/
 public static function getModule(&$obj, $module)
 {
     if ($module->getInfo('trust_dirname') == 'rpglink') {
         require_once RPGLINK_TRUST_PATH . '/class/Module.class.php';
         $obj = new Rpglink_Module($module);
     }
 }
开发者ID:kilica,项目名称:playermap,代码行数:15,代码来源:AssetPreload.class.php

示例6: getModule

 /**
  * get module.
  * 
  * @param Legacy_AbstractModule &$obj
  * @param XoopsModule           $module
  */
 public static function getModule(&$obj, $module)
 {
     if ($module->getInfo('trust_dirname') == COSMOAPI_TRUST_DIRNAME) {
         $mytrustdirname = COSMOAPI_TRUST_DIRNAME;
         require_once XOOPS_TRUST_PATH . '/modules/' . COSMOAPI_TRUST_DIRNAME . '/class/Module.class.php';
         $className = ucfirst(COSMOAPI_TRUST_DIRNAME) . '_Module';
         $obj = new $className($module);
     }
 }
开发者ID:neuroinformatics,项目名称:xcl-module-cosmoapi,代码行数:15,代码来源:AssetPreload.class.php

示例7: _uninstallTables

 /**
  * uninstall tables.
  */
 private function _uninstallTables()
 {
     $dirname = $this->_mXoopsModule->get('dirname');
     $constpref = '_MI_' . strtoupper($dirname);
     $root =& XCube_Root::getSingleton();
     $db =& $root->mController->getDB();
     $tables =& $this->_mXoopsModule->getInfo('tables');
     if (is_array($tables)) {
         foreach ($tables as $table) {
             $tableName = str_replace(array('{prefix}', '{dirname}'), array(XOOPS_DB_PREFIX, $dirname), $table);
             $sql = sprintf('DROP TABLE `%s`;', $tableName);
             if ($db->query($sql)) {
                 $this->mLog->addReport(XCube_Utils::formatString(constant($constpref . '_INSTALL_MSG_TABLE_DOROPPED'), $tableName));
             } else {
                 $this->mLog->addError(XCube_Utils::formatString(constant($constpref . '_INSTALL_ERROR_TABLE_DOROPPED'), $tableName));
             }
         }
     }
 }
开发者ID:neuroinformatics,项目名称:xcl-module-cosmoapi,代码行数:22,代码来源:Uninstaller.class.php

示例8: 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);
 }
开发者ID:JustineBABY,项目名称:rmcommon,代码行数:52,代码来源:modules.class.php

示例9: _processReport

 /**
  * process report.
  */
 private function _processReport()
 {
     $dirname = $this->_mXoopsModule->get('dirname');
     $constpref = '_MI_' . strtoupper($dirname);
     if (!$this->mLog->hasError()) {
         $this->mLog->add(XCube_Utils::formatString(constant($constpref . '_INSTALL_MSG_MODULE_INSTALLED'), $this->_mXoopsModule->getInfo('name')));
     } elseif (is_object($this->_mXoopsModule)) {
         $this->mLog->addError(XCube_Utils::formatString(constant($constpref . '_INSTALL_ERROR_MODULE_INSTALLED'), $this->_mXoopsModule->getInfo('name')));
     } else {
         $this->mLog->addError(XCube_Utils::formatString(constant($constpref . '_INSTALL_ERROR_MODULE_INSTALLED'), 'something'));
     }
 }
开发者ID:neuroinformatics,项目名称:xcl-module-cosmoapi,代码行数:15,代码来源:Installer.class.php

示例10: trim

 function _processScript()
 {
     $installScript = trim($this->_mTargetXoopsModule->getInfo('onUpdate'));
     if ($installScript != false) {
         require_once XOOPS_MODULE_PATH . "/" . $this->_mTargetXoopsModule->get('dirname') . "/" . $installScript;
         $funcName = 'xoops_module_update_' . $this->_mTargetXoopsModule->get('dirname');
         if (function_exists($funcName)) {
             if (!call_user_func($funcName, $this->_mTargetXoopsModule, $this->getCurrentVersion(), new XCube_Ref($this->mLog))) {
                 $this->mLog->addError("Failed to execute " . $funcName);
             }
         }
     }
 }
开发者ID:nunoluciano,项目名称:uxcl,代码行数:13,代码来源:ModuleUpdater.class.php

示例11: get_modules_list

function get_modules_list()
{
    $db = XoopsDatabaseFactory::getDatabaseConnection();
    $sql = 'SELECT * FROM ' . $db->prefix('modules') . " ORDER BY mid, weight";
    $result = $db->query($sql);
    $installed_mods = array();
    while ($row = $db->fetchArray($result)) {
        $mod = new XoopsModule();
        $mod->assignVars($row);
        $module_icon = $mod->getInfo('icon48') != '' ? XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . $mod->getInfo('icon48') : '';
        $module_logo = XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . $mod->getInfo('image');
        if ($mod->hasconfig()) {
            $config_link = $mod->getInfo('rmnative') ? XOOPS_URL . '/modules/rmcommon/settings.php?action=configure&amp;mod=' . $mod->mid() : XOOPS_URL . '/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=' . $mod->mid();
        }
        $this_module = array('name' => $mod->getVar('name'), 'dirname' => $mod->getVar('dirname'), 'real_name' => $mod->getInfo('name'), 'version' => is_array($mod->getInfo('rmversion')) ? RMModules::format_module_version($mod->getInfo('rmversion')) : $mod->getVar('version') / 100, 'icon' => $module_icon, 'logo' => $module_logo, 'admin' => $mod->getVar('hasadmin') ? XOOPS_URL . '/modules/' . $mod->getVar('dirname') . '/' . $mod->getInfo('adminindex') : '', 'main' => RMUris::anchor($mod->getVar('dirname')), 'updated' => RMTimeFormatter::get()->format($mod->getVar('last_update'), __('%d% %T% %Y%', 'rmcommon')), 'config' => isset($config_link) ? $config_link : '', 'description' => $mod->getInfo('description'));
        $installed_mods[] = (object) $this_module;
    }
    return $installed_mods;
}
开发者ID:txmodxoops,项目名称:rmcommon,代码行数:19,代码来源:index.php

示例12: trim

 function _processScript()
 {
     $installScript = trim($this->_mTargetXoopsModule->getInfo('onUpdate'));
     if ($installScript != false) {
         require_once XOOPS_MODULE_PATH . "/" . $this->_mTargetXoopsModule->get('dirname') . "/" . $installScript;
         $funcName = 'xoops_module_update_' . $this->_mTargetXoopsModule->get('dirname');
         if (function_exists($funcName)) {
             // Because X2 can use reference parameter, Legacy doesn't use the following code;'
             //if (!call_user_func($funcName, $this->_mTargetXoopsModule, $this->getCurrentVersion(), new XCube_Ref($this->mLog))) {
             $result = $funcName($this->_mTargetXoopsModule, $this->getCurrentVersion(), new XCube_Ref($this->mLog));
             if (!$result) {
                 $this->mLog->addError("Failed to execute " . $funcName);
             }
         }
     }
 }
开发者ID:hiro1173,项目名称:legacy,代码行数:16,代码来源:ModuleUpdater.class.php

示例13: renderAbout

 /**
  * Render about page
  *
  * @param bool $logo_xoops show logo
  *
  * @return bool|mixed|string
  */
 public function renderAbout($logo_xoops = true)
 {
     $xoops = \Xoops::getInstance();
     $date = explode('/', $this->module->getInfo('release_date'));
     $author = explode(',', $this->module->getInfo('author'));
     $nickname = explode(',', $this->module->getInfo('nickname'));
     $release_date = \XoopsLocale::formatTimestamp(mktime(0, 0, 0, $date[1], $date[2], $date[0]), 's');
     $author_list = '';
     foreach (array_keys($author) as $i) {
         $author_list .= $author[$i];
         if (isset($nickname[$i]) && $nickname[$i] != '') {
             $author_list .= " (" . $nickname[$i] . "), ";
         } else {
             $author_list .= ", ";
         }
     }
     $changelog = '';
     $language = $xoops->getConfig('locale');
     if (!is_file(\XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") . "/locale/" . $language . "/changelog.txt")) {
         $language = 'en_US';
     }
     $file = \XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") . "/locale/" . $language . "/changelog.txt";
     if (is_readable($file)) {
         $changelog = utf8_encode(implode("<br />", file($file))) . "\n";
     } else {
         $file = \XoopsBaseConfig::get('root-path') . "/modules/" . $this->module->getVar("dirname") . "/docs/changelog.txt";
         if (is_readable($file)) {
             $changelog = utf8_encode(implode("<br />", file($file))) . "\n";
         }
     }
     $author_list = substr($author_list, 0, -2);
     $this->module->setInfo('release_date', $release_date);
     $this->module->setInfo('author_list', $author_list);
     if (is_array($this->module->getInfo('paypal'))) {
         $this->module->setInfo('paypal', $this->module->getInfo('paypal'));
     }
     $this->module->setInfo('changelog', $changelog);
     $xoops->tpl()->assign('module', $this->module);
     $this->addInfoBox(\XoopsLocale::MODULE_INFORMATION, 'info', 'id="xo-about"');
     $this->addInfoBoxLine(\XoopsLocale::C_DESCRIPTION . ' ' . $this->module->getInfo("description"), 'info');
     $this->addInfoBoxLine(\XoopsLocale::C_UPDATE_DATE . ' <span class="bold">' . \XoopsLocale::formatTimestamp($this->module->getVar("last_update"), "m") . '</span>', 'info');
     $this->addInfoBoxLine(\XoopsLocale::C_WEBSITE . ' <a class="xo-tooltip" href="http://' . $this->module->getInfo("module_website_url") . '" rel="external" title="' . $this->module->getInfo("module_website_name") . ' - ' . $this->module->getInfo("module_website_url") . '">' . $this->module->getInfo("module_website_name") . '</a>', 'info');
     $xoops->tpl()->assign('xoops_logo', $logo_xoops);
     $xoops->tpl()->assign('xo_admin_box', $this->itemInfoBox);
     return $xoops->tpl()->fetch($this->getTplPath('about'));
 }
开发者ID:RanLee,项目名称:XoopsCore,代码行数:53,代码来源:Admin.php

示例14: trim

 function _processScript()
 {
     $installScript = trim($this->_mXoopsModule->getInfo('onUninstall'));
     if ($installScript != false) {
         require_once XOOPS_MODULE_PATH . "/" . $this->_mXoopsModule->get('dirname') . "/" . $installScript;
         $funcName = 'xoops_module_uninstall_' . $this->_mXoopsModule->get('dirname');
         if (!preg_match("/^[a-zA-Z_][a-zA-Z0-9_]*\$/", $funcName)) {
             $this->mLog->addError(XCUbe_Utils::formatMessage(_AD_LEGACY_ERROR_FAILED_TO_EXECUTE_CALLBACK, $funcName));
             return;
         }
         if (function_exists($funcName)) {
             if (!call_user_func($funcName, $this->_mXoopsModule, new XCube_Ref($this->mLog))) {
                 $this->mLog->addError(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_FAILED_TO_EXECUTE_CALLBACK, $funcName));
             }
         }
     }
 }
开发者ID:nunoluciano,项目名称:uxcl,代码行数:17,代码来源:ModuleUninstaller.class.php

示例15: 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;
 }
开发者ID:laiello,项目名称:bitcero-modules,代码行数:50,代码来源:utilities.php


注:本文中的XoopsModule::getInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。