本文整理汇总了PHP中XoopsLists类的典型用法代码示例。如果您正苦于以下问题:PHP XoopsLists类的具体用法?PHP XoopsLists怎么用?PHP XoopsLists使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XoopsLists类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_rm_plugins
function show_rm_plugins()
{
$path = RMCPATH . '/plugins';
$dir_list = XoopsLists::getDirListAsArray($path);
$available_plugins = array();
$installed_plugins = array();
foreach ($dir_list as $dir) {
if (!file_exists($path . '/' . $dir . '/' . strtolower($dir) . '-plugin.php')) {
continue;
}
$phand = new RMPlugin($dir);
// PLugin handler
if ($phand->isNew()) {
$phand->setVar('dir', $dir);
$available_plugins[] = $phand;
} else {
$installed_plugins[] = $phand;
}
}
rm_reload_plugins();
RMFunctions::create_toolbar();
xoops_cp_header();
include RMTemplate::get()->get_template('rmc_plugins.php', 'module', 'rmcommon');
xoops_cp_footer();
}
示例2: edit_bookmark
/**
* @desc Muestra el formulario para agregar un nuevo sitio
*/
function edit_bookmark()
{
global $xoopsModule, $xoopsConfig, $xoopsSecurity, $rmTpl;
$id = rmc_server_var($_GET, 'id', 0);
if ($id <= 0) {
redirectMsg('bookmarks.php', __('Site ID not provided!', 'mywords'), 1);
die;
}
$book = new MWBookmark($id);
if ($book->isNew()) {
redirectMsg('bookmarks.php', __('Social site not exists!', 'mywords'), 1);
die;
}
$temp = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . '/modules/mywords/images/icons');
foreach ($temp as $icon) {
$icons[] = array('url' => XOOPS_URL . "/modules/mywords/images/icons/{$icon}", 'name' => $icon);
}
MWFunctions::include_required_files();
RMBreadCrumb::get()->add_crumb(__('Social Sites', 'mywords'), 'bookmarks.php');
RMBreadCrumb::get()->add_crumb(__('Edit Site', 'mywords'));
xoops_cp_header();
$show_edit = true;
include $rmTpl->get_template('admin/mywords_bookmarks.php', 'module', 'mywords');
$rmTpl->assign('xoops_pagetitle', __('Edit Social Site', 'mywords'));
$rmTpl->add_script(RMCURL . '/include/js/jquery.checkboxes.js');
$rmTpl->add_script('../include/js/scripts.php?file=bookmarks.js');
xoops_cp_footer();
}
示例3: getDump
/**
* @return void
*/
public function getDump()
{
$xoops = Xoops::getInstance();
$maintenance = new Maintenance();
parent::__construct('', "form_dump", "dump.php", 'post', true);
$dump_tray = new Xoops\Form\ElementTray(_AM_MAINTENANCE_DUMP_TABLES_OR_MODULES, '');
$select_tables1 = new Xoops\Form\Select('', "dump_tables", '', 7, true);
$select_tables1->addOptionArray($maintenance->displayTables(true));
$dump_tray->addElement($select_tables1, false);
$ele = new Xoops\Form\Select(' ' . _AM_MAINTENANCE_OR . ' ', 'dump_modules', '', 7, true);
$module_list = XoopsLists::getModulesList();
$module_handler = $xoops->getHandlerModule();
foreach ($module_list as $file) {
if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $file . '/xoops_version.php')) {
clearstatcache();
$file = trim($file);
$module = $module_handler->create();
$module->loadInfo($file);
if ($module->getInfo('tables') && $xoops->isActiveModule($file)) {
$ele->addOption($module->getInfo('dirname'), $module->getInfo('name'));
}
unset($module);
}
}
$dump_tray->addElement($ele);
$this->addElement($dump_tray);
$this->addElement(new Xoops\Form\RadioYesNo(_AM_MAINTENANCE_DUMP_DROP, 'drop', 1));
$this->addElement(new Xoops\Form\Hidden("op", "dump_save"));
$this->addElement(new Xoops\Form\Button("", "dump_save", XoopsLocale::A_SUBMIT, "submit"));
}
示例4: b_user_topusers_edit
function b_user_topusers_edit($options)
{
include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
$inputtag = '<input type="text" name="options[]" value="'.intval($options[0]).'" />';
$form = sprintf(_MB_USER_DISPLAY,$inputtag);
$form .= '<br />'._MB_USER_DISPLAYA.' <input type="radio" id="options[]" name="options[]" value="1"';
if ( $options[1] == 1 ) {
$form .= ' checked="checked"';
}
$form .= ' /> '._YES.'<input type="radio" id="options[]" name="options[]" value="0"';
if ( $options[1] == 0 ) {
$form .= ' checked="checked"';
}
$form .= ' /> '._NO;
$form .= '<br />'._MB_USER_NODISPGR.'<br /><select id="options[]" name="options[]" multiple="multiple">';
$ranks =& XoopsLists::getUserRankList();
$size = count($options);
foreach ($ranks as $k => $v) {
$sel = "";
for ( $i = 2; $i < $size; $i++ ) {
if ($k == $options[$i]) {
$sel = ' selected="selected"';
}
}
$form .= '<option value="'.$k.'"'.$sel.'>'.$v.'</option>';
}
$form .= '</select>';
return $form;
}
示例5: load_extra_preloads
public function load_extra_preloads($dir, $name)
{
$dir = rtrim($dir, '/');
$extra = array();
if (is_dir($dir . '/events')) {
$file_list = XoopsLists::getFileListAsArray($dir . '/events');
foreach ($file_list as $file) {
if (preg_match('/(\\.php)$/i', $file)) {
$file = substr($file, 0, -4);
$extra[] = $file;
}
}
}
foreach ($extra as $preload) {
include_once $dir . '/events/' . $preload . '.php';
$class_name = ucfirst($name) . ucfirst($preload) . 'Preload';
if (!class_exists($class_name)) {
continue;
}
$class_methods = get_class_methods($class_name);
foreach ($class_methods as $method) {
if (strpos($method, 'event') === 0) {
$event_name = strtolower(str_replace('event', '', $method));
$event = array('class_name' => $class_name, 'method' => $method);
$this->_events[$event_name][] = $event;
}
}
}
}
示例6: b_cubeUtils_langsel_show
function b_cubeUtils_langsel_show($options)
{
if (empty($_SERVER['QUERY_STRING'])) {
$pagenquery = $_SERVER['PHP_SELF'] . '?' . CUBE_UTILS_ML_PARAM_NAME . '=';
} elseif (isset($_SERVER['QUERY_STRING'])) {
$query = explode("&", $_SERVER['QUERY_STRING']);
$langquery = $_SERVER['QUERY_STRING'];
// If the last parameter of the QUERY_STRING is sel_lang, delete it so we don't have repeating sel_lang=...
if (strpos($query[count($query) - 1], CUBE_UTILS_ML_PARAM_NAME . '=') === 0) {
$langquery = str_replace('&' . $query[count($query) - 1], '', $langquery);
}
$pagenquery = $_SERVER['PHP_SELF'] . '?' . $langquery . '&' . CUBE_UTILS_ML_PARAM_NAME . '=';
$pagenquery = str_replace('?&', '?', $pagenquery);
}
//show a drop down list to select language
$block['content'] = "<script type='text/javascript'>\r\n<!--\r\nfunction SelLang_jumpMenu(targ,selObj,restore){\r\neval(targ+\".location='" . $pagenquery . "\"+selObj.options[selObj.selectedIndex].value+\"'\");\r\nif (restore) selObj.selectedIndex=0;\r\n}\r\n-->\r\n</script>";
$block['content'] .= '<div align="center"><select name="' . CUBE_UTILS_ML_PARAM_NAME . '" onChange="SelLang_jumpMenu(\'parent\',this,0)">';
$languages = XoopsLists::getLangList();
$langnames = explode(',', CUBE_UTILS_ML_LANGDESCS);
$langs = explode(',', CUBE_UTILS_ML_LANGS);
for ($i = 0; $i < count($langs); $i++) {
$block['content'] .= '<option value="' . $langs[$i] . '"';
if ($langs[$i] == _LANGCODE) {
$block['content'] .= " selected";
}
$block['content'] .= '>' . $langnames[$i] . '</option>';
}
$block['content'] .= '</select></div>';
return $block;
}
示例7: array
function &getList($noHtml = false)
{
static $editors;
if (!isset($editors)) {
$order = array();
$list = XoopsLists::getDirListAsArray($this->root_path . '/');
foreach ($list as $item) {
if (is_readable($this->root_path . '/' . $item . '/editor_registry.php')) {
include $this->root_path . '/' . $item . '/editor_registry.php';
if (empty($config['order'])) {
continue;
}
$editors[$config['name']] = $config;
$order[] = $config['order'];
}
}
array_multisort($order, $editors);
}
$_list = array();
foreach ($editors as $name => $item) {
if (!empty($noHtml) && empty($item['nohtml'])) {
continue;
}
$_list[$name] = $item['title'];
}
return $_list;
}
示例8: __construct
/**
* @param null $obj
*/
public function __construct($obj = null)
{
$xoops = Xoops::getInstance();
parent::__construct('', 'xlanguage_form', $xoops->getEnv('PHP_SELF'), 'post', true, 'horizontal');
// language name
$xlanguage_select = new Xoops\Form\Select(_AM_XLANGUAGE_NAME, 'xlanguage_name', $obj->getVar('xlanguage_name'));
$xlanguage_select->addOptionArray(XoopsLists::getLocaleList());
$this->addElement($xlanguage_select, true);
// language description
$this->addElement(new Xoops\Form\Text(_AM_XLANGUAGE_DESCRIPTION, 'xlanguage_description', 5, 30, $obj->getVar('xlanguage_description')), true);
// language charset
$autoload = XoopsLoad::loadConfig('xlanguage');
$charset_select = new Xoops\Form\Select(_AM_XLANGUAGE_CHARSET, 'xlanguage_charset', $obj->getVar('xlanguage_charset'));
$charset_select->addOptionArray($autoload['charset']);
$this->addElement($charset_select);
// language code
$this->addElement(new Xoops\Form\Text(_AM_XLANGUAGE_CODE, 'xlanguage_code', 5, 10, $obj->getVar('xlanguage_code')), true);
// language weight
$this->addElement(new Xoops\Form\Text(_AM_XLANGUAGE_WEIGHT, 'xlanguage_weight', 1, 4, $obj->getVar('xlanguage_weight')));
// language image
$image_option_tray = new Xoops\Form\ElementTray(_AM_XLANGUAGE_IMAGE, '');
$image_array = XoopsLists::getImgListAsArray(\XoopsBaseConfig::get('root-path') . '/media/xoops/images/flags/' . \Xoops\Module\Helper::getHelper('xlanguage')->getConfig('theme') . '/');
$image_select = new Xoops\Form\Select('', 'xlanguage_image', $obj->getVar('xlanguage_image'));
$image_select->addOptionArray($image_array);
$image_select->setExtra("onchange='showImgSelected(\"image\", \"xlanguage_image\", \"/media/xoops/images/flags/" . \Xoops\Module\Helper::getHelper('xlanguage')->getConfig('theme') . "/\", \"\", \"" . \XoopsBaseConfig::get('url') . "\")'");
$image_tray = new Xoops\Form\ElementTray('', ' ');
$image_tray->addElement($image_select);
$image_tray->addElement(new Xoops\Form\Label('', "<div style='padding: 8px;'><img style='width:24px; height:24px; ' src='" . \XoopsBaseConfig::get('url') . "/media/xoops/images/flags/" . \Xoops\Module\Helper::getHelper('xlanguage')->getConfig('theme') . "/" . $obj->getVar("xlanguage_image") . "' name='image' id='image' alt='' /></div>"));
$image_option_tray->addElement($image_tray);
$this->addElement($image_option_tray);
$this->addElement(new Xoops\Form\Hidden('xlanguage_id', $obj->getVar('xlanguage_id')));
/**
* Buttons
*/
$button_tray = new Xoops\Form\ElementTray('', '');
$button_tray->addElement(new Xoops\Form\Hidden('op', 'save'));
$button = new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit');
$button->setClass('btn btn-success');
$button_tray->addElement($button);
$button_2 = new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset');
$button_2->setClass('btn btn-warning');
$button_tray->addElement($button_2);
switch (basename($xoops->getEnv('PHP_SELF'), '.php')) {
case 'xoops_xlanguage':
$button_3 = new Xoops\Form\Button('', 'button', XoopsLocale::A_CLOSE, 'button');
$button_3->setExtra('onclick="tinyMCEPopup.close();"');
$button_3->setClass('btn btn-danger');
$button_tray->addElement($button_3);
break;
case 'index':
default:
$button_3 = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
$button_3->setExtra("onclick='javascript:history.go(-1);'");
$button_3->setClass('btn btn-danger');
$button_tray->addElement($button_3);
break;
}
$this->addElement($button_tray);
}
示例9: __construct
/**
* @param BannersBanner|XoopsObject $obj
*/
public function __construct(BannersBanner &$obj)
{
$xoops = Xoops::getInstance();
$helper = Banners::getInstance();
if ($obj->isNew()) {
$blank_img = 'blank.gif';
$html_banner = 0;
} else {
if (substr_count($obj->getVar('banner_imageurl'), $xoops_upload_url . '/banners/') == 0) {
$blank_img = 'blank.gif';
} else {
$namefile = substr_replace($obj->getVar('banner_imageurl'), '', 0, strlen($xoops_upload_url . '/banners/'));
$pathfile = $xoops_root_path . '/uploads/banners/' . $namefile;
if (is_file($pathfile)) {
$blank_img = str_replace($xoops_upload_url . '/banners/', '', $obj->getVar('banner_imageurl', 'e'));
} else {
$blank_img = 'blank.gif';
}
}
$html_banner = $obj->getVar('banner_htmlbanner');
}
$title = $obj->isNew() ? sprintf(_AM_BANNERS_BANNERS_ADD) : sprintf(_AM_BANNERS_BANNERS_EDIT);
parent::__construct($title, 'form', 'banners.php', 'post', true);
$this->setExtra('enctype="multipart/form-data"');
$client_Handler = $helper->getHandlerBannerclient();
$client_select = new Xoops\Form\Select(_AM_BANNERS_CLIENTS_NAME, 'cid', $obj->getVar('banner_cid'));
$client_select->addOptionArray($client_Handler->getList());
$this->addElement($client_select, true);
$imptotal = new Xoops\Form\Text(_AM_BANNERS_BANNERS_IMPRESSIONSP, 'imptotal', 1, 255, $obj->getVar('banner_imptotal'));
//$imptotal->setPattern('^[0-9]*[0-9]+$|^[0-9]+[0-9]*$', _AM_BANNERS_BANNERS_IMPRESSIONSP_PATTERN);
$this->addElement($imptotal, true);
$imgtray_img = new Xoops\Form\ElementTray(_AM_BANNERS_BANNERS_IMAGE, '<br /><br />');
$imgtray_img->addElement(new Xoops\Form\Text(_AM_BANNERS_BANNERS_IMGURL, 'imageurl', 8, 255, $obj->getVar('banner_imageurl')));
$imgpath_img = sprintf(_AM_BANNERS_BANNERS_IMAGE_PATH, $xoops_upload_path . '/banners/');
$imageselect_img = new Xoops\Form\Select($imgpath_img, 'banners_imageurl', $blank_img);
$image_array_img = XoopsLists::getImgListAsArray($xoops_upload_path . '/banners');
$imageselect_img->addOption("{$blank_img}", $blank_img);
foreach ($image_array_img as $image_img) {
$imageselect_img->addOption("{$image_img}", $image_img);
}
$imageselect_img->setExtra('onchange="showImgSelected(\'xo-banners-img\', \'banners_imageurl\', \'banners\', \'\', \'' . $xoops_upload_url . '\' )"');
$imgtray_img->addElement($imageselect_img, false);
$imgtray_img->addElement(new Xoops\Form\Label('', "<br /><img src='" . $xoops_upload_url . "/banners/" . $blank_img . "' name='image_img' id='xo-banners-img' alt='' />"));
$fileseltray_img = new Xoops\Form\ElementTray('<br />', '<br /><br />');
$fileseltray_img->addElement(new Xoops\Form\File(_AM_BANNERS_BANNERS_UPLOADS, 'banners_imageurl'), false);
$fileseltray_img->addElement(new Xoops\Form\Label(''), false);
$imgtray_img->addElement($fileseltray_img);
$this->addElement($imgtray_img);
$this->addElement(new Xoops\Form\Text(_AM_BANNERS_BANNERS_CLICKURL, 'clickurl', 5, 255, $obj->getVar('banner_clickurl')), false);
$this->addElement(new Xoops\Form\RadioYesNo(_AM_BANNERS_BANNERS_USEHTML, 'htmlbanner', $html_banner));
$this->addElement(new Xoops\Form\TextArea(_AM_BANNERS_BANNERS_CODEHTML, 'htmlcode', $obj->getVar('banner_htmlcode'), 5, 5), false);
if (!$obj->isNew()) {
$this->addElement(new Xoops\Form\Hidden('bid', $obj->getVar('banner_bid')));
}
$this->addElement(new Xoops\Form\Hidden('op', 'save'));
$this->addElement(new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit'));
}
示例10: __construct
/**
* @param SmiliesSmiley|XoopsObject $obj
*/
public function __construct(SmiliesSmiley $obj)
{
$xoops = Xoops::getInstance();
if ($obj->isNew()) {
$blank_img = 'blank.gif';
} else {
$blank_img = str_replace('smilies/', '', $obj->getVar('smiley_url', 'e'));
}
$title = $obj->isNew() ? sprintf(_AM_SMILIES_ADD) : sprintf(_AM_SMILIES_EDIT);
parent::__construct($title, 'form', $xoops->getEnv('PHP_SELF'), 'post', true);
$this->setExtra('enctype="multipart/form-data"');
$this->addElement(new Xoops\Form\Text(_AM_SMILIES_CODE, 'smiley_code', 2, 25, $obj->getVar('smiley_code')), true);
$this->addElement(new Xoops\Form\Text(_AM_SMILIES_DESCRIPTION, 'smiley_emotion', 4, 50, $obj->getVar('smiley_emotion')), true);
$imgtray_img = new Xoops\Form\ElementTray(_AM_SMILIES_FILE, '<br />');
$imgpath_img = sprintf(_AM_SMILIES_IMAGE_PATH, \XoopsBaseConfig::get('uploads-url') . '/smilies/');
$imageselect_img = new Xoops\Form\Select($imgpath_img, 'smiley_url', $blank_img);
$image_array_img = XoopsLists::getImgListAsArray(\XoopsBaseConfig::get('uploads-url') . '/smilies');
$imageselect_img->addOptionArray($image_array_img);
$imageselect_img->setExtra('onchange="showImgSelected(\'xo-smilies-img\', \'smiley_url\', \'smilies\', \'\', \'' . \XoopsBaseConfig::get('uploads-url') . '\' )"');
$imgtray_img->addElement($imageselect_img, false);
$imgtray_img->addElement(new Xoops\Form\Label('', "<br /><img src='" . \XoopsBaseConfig::get('uploads-url') . "/smilies/" . $blank_img . "' name='image_img' id='xo-smilies-img' alt=''>"));
$fileseltray_img = new Xoops\Form\ElementTray('<br />', '<br /><br />');
$fileseltray_img->addElement(new Xoops\Form\File(_AM_SMILIES_UPLOADS, 'smiley_url'), false);
$fileseltray_img->addElement(new Xoops\Form\Label(''), false);
$imgtray_img->addElement($fileseltray_img);
$this->addElement($imgtray_img);
$this->addElement(new Xoops\Form\RadioYesNo(_AM_SMILIES_OFF, 'smiley_display', $obj->getVar('smiley_display')));
$this->addElement(new Xoops\Form\Hidden('smiley_id', $obj->getVar('smiley_id')));
/**
* Buttons
*/
$button_tray = new Xoops\Form\ElementTray('', '');
$button_tray->addElement(new Xoops\Form\Hidden('op', 'save'));
$button = new Xoops\Form\Button('', 'submit', XoopsLocale::A_SUBMIT, 'submit');
$button->setClass('btn btn-success');
$button_tray->addElement($button);
$button_2 = new Xoops\Form\Button('', 'reset', XoopsLocale::A_RESET, 'reset');
$button_2->setClass('btn btn-warning');
$button_tray->addElement($button_2);
switch (basename($xoops->getEnv('PHP_SELF'), '.php')) {
case 'xoops_smilies':
$button_3 = new Xoops\Form\Button('', 'button', XoopsLocale::A_CLOSE, 'button');
$button_3->setExtra('onclick="tinyMCEPopup.close();"');
$button_3->setClass('btn btn-danger');
$button_tray->addElement($button_3);
break;
case 'smilies':
default:
$button_3 = new Xoops\Form\Button('', 'cancel', XoopsLocale::A_CANCEL, 'button');
$button_3->setExtra("onclick='javascript:history.go(-1);'");
$button_3->setClass('btn btn-danger');
$button_tray->addElement($button_3);
break;
}
$this->addElement($button_tray);
}
示例11: getLanguages
function getLanguages()
{
include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
$aLanguages = XoopsLists::getLangList();
$ret['default'] = _CO_SOBJECT_ALL;
foreach ($aLanguages as $lang) {
$ret[$lang] = $lang;
}
return $ret;
}
示例12: setPlugins
function setPlugins()
{
if (is_dir($dir = $GLOBALS['xoops']->path('modules/mymenus/plugins/'))) {
$plugins_list = XoopsLists::getDirListAsArray($dir, '');
foreach ($plugins_list as $plugin) {
if (file_exists($GLOBALS['xoops']->path("modules/mymenus/plugins/{$plugin}/{$plugin}.php"))) {
$this->_plugins[] = $plugin;
}
}
}
}
示例13: b_system_topposters_edit
function b_system_topposters_edit($options)
{
$block_form = new Xoops\Form\BlockForm();
$block_form->addElement(new Xoops\Form\Text(SystemLocale::NUMBER_OF_USERS_TO_DISPLAY, 'options[0]', 1, 3, $options[0]), true);
$block_form->addElement(new Xoops\Form\RadioYesNo(SystemLocale::DISPLAY_USERS_AVATARS, 'options[1]', $options[1]));
$ranks = XoopsLists::getUserRankList();
$ranks_select = new Xoops\Form\Select(SystemLocale::C_DO_NOT_DISPLAY_USERS_WHOSE_RANK_IS, 'options[2]', explode(',', $options[2]), 5, true);
$ranks_select->addOptionArray($ranks);
$block_form->addElement($ranks_select);
return $block_form->render();
}
示例14: eventCoreFooterEnd
/**
* @param $args
*/
function eventCoreFooterEnd($args)
{
global $resourcesModule, $resourcesConfigsList;
if (empty($resourcesModule)) {
if (is_a($resourcesModule = xoops_gethandler('module')->getByDirname(basename(dirname(__DIR__))), "XoopsModule")) {
if (empty($resourcesConfigsList)) {
$resourcesConfigsList = xoops_gethandler('config')->getConfigsList($resourcesModule->getVar('mid'));
}
}
}
xoops_load("XoopsCache");
xoops_load("XoopsLists");
if (!($themes = XoopsCache::read(basename(dirname(__DIR__)) . '.available.themes'))) {
$themes = json_decode(getURIData(sprintf(_MI_RESOURCES_THEMES, _RESOURCES_SUPPORTING)), true);
if (!empty($themes)) {
XoopsCache::write(basename(dirname(__DIR__)) . '.available.themes', $themes, 3600 * mt_rand(2.99999, 12.99999));
}
}
if (!($modules = XoopsCache::read(basename(dirname(__DIR__)) . '.available.modules'))) {
$modules = json_decode(getURIData(sprintf(_MI_RESOURCES_MODULES, _RESOURCES_SUPPORTING)), true);
if (!empty($themes)) {
XoopsCache::write(basename(dirname(__DIR__)) . '.available.modules', $modules, 3600 * mt_rand(2.99999, 12.99999));
}
}
if (!($peers = XoopsCache::read(basename(dirname(__DIR__)) . '.available.peers'))) {
$peers = json_decode(getURIData(sprintf(_MI_RESOURCES_PEERS, _RESOURCES_SUPPORTING)), true);
if (!empty($themes)) {
XoopsCache::write(basename(dirname(__DIR__)) . '.available.peers', $peers, 3600 * 24 * mt_rand(5.99999, 24.99999));
}
}
if (!($modules = XoopsCache::read(basename(dirname(__DIR__)) . '.modules.delays') && $resourcesConfigsList['harvester'])) {
XoopsCache::write(basename(dirname(__DIR__)) . '.modules', true, 3600 * 24 * 29);
XoopsCache::write(basename(dirname(__DIR__)) . '.modules.delays', $modules = XoopsLists::getModulesList(), 3600 * 24 * 31);
foreach ($modules as $module) {
$map = getFolderMap($GLOBALS['xoops']->path('/modules/' . $module));
XoopsCache::write(basename(dirname(__DIR__)) . '.module' . $module, true, $seconds = 3600 * 24 * mt_rand(21.69999, 42.998876));
XoopsCache::write(basename(dirname(__DIR__)) . '.module' . $module . '.delays', $map, $seconds + 3600 * 4);
if (is_dir(XOOPS_PATH . '/modules/' . $module)) {
$map = getFolderMap(XOOPS_PATH . '/modules/' . $module, XOOPS_PATH);
XoopsCache::write(basename(dirname(__DIR__)) . '.xoopslib' . $module, true, $seconds);
XoopsCache::write(basename(dirname(__DIR__)) . '.xoopslib' . $module . '.delays', $map, $seconds + 3600 * 4);
}
}
}
if (!($themes = XoopsCache::read(basename(dirname(__DIR__)) . '.themes.delays') && $resourcesConfigsList['harvester'])) {
XoopsCache::write(basename(dirname(__DIR__)) . '.themes', true, 3600 * 24 * 29);
XoopsCache::write(basename(dirname(__DIR__)) . '.themes.delays', $themes = XoopsLists::getThemesList(), 3600 * 24 * 31);
foreach ($themes as $theme) {
$map = getFolderMap($GLOBALS['xoops']->path('/themes/' . $theme));
XoopsCache::write(basename(dirname(__DIR__)) . '.theme' . $theme, true, $seconds = 3600 * 24 * mt_rand(21.69999, 42.998876));
XoopsCache::write(basename(dirname(__DIR__)) . '.theme' . $theme . '.delays', $map, $seconds + 3600 * 4);
}
}
}
示例15: __construct
/**
* Constructor
*/
public function __construct()
{
// Get main instance
$xoops = Xoops::getInstance();
$module_handler = $xoops->getHandlerModule();
$this->modulesList = XoopsLists::getModulesList();
$modules = $module_handler->getObjectsArray();
/* @var $module XoopsModule */
foreach ($modules as $module) {
$this->modulesDirnames[] = $module->getInfo('dirname');
}
}