本文整理汇总了PHP中XoopsLists类的典型用法代码示例。如果您正苦于以下问题:PHP XoopsLists类的具体用法?PHP XoopsLists怎么用?PHP XoopsLists使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XoopsLists类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:25,代码来源:plugins.php
示例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();
}
开发者ID:JustineBABY,项目名称:mywords,代码行数:31,代码来源:bookmarks.php
示例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"));
}
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:33,代码来源:maintenance.php
示例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;
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:29,代码来源:user_topusers.php
示例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;
}
}
}
}
开发者ID:txmodxoops,项目名称:rmcommon,代码行数:29,代码来源:events.php
示例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;
}
开发者ID:nobunobuta,项目名称:xoopscube_cubeUtils,代码行数:30,代码来源:cubeUtils_langsel.php
示例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;
}
开发者ID:BackupTheBerlios,项目名称:soopa,代码行数:27,代码来源:xoopseditor.php
示例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);
}
开发者ID:redmexico,项目名称:XoopsCore,代码行数:62,代码来源:language.php
示例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'));
}
开发者ID:redmexico,项目名称:XoopsCore,代码行数:60,代码来源:banner.php
示例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);
}
开发者ID:redmexico,项目名称:XoopsCore,代码行数:59,代码来源:smilies.php
示例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;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:10,代码来源:smartobjecttag.php
示例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;
}
}
}
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:11,代码来源:plugin.php
示例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();
}
开发者ID:RanLee,项目名称:XoopsCore,代码行数:11,代码来源:topposters.php
示例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);
}
}
}
开发者ID:ChronolabsCooperative,项目名称:Xoops25ModuleResources,代码行数:57,代码来源:core.php
示例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');
}
}
开发者ID:redmexico,项目名称:XoopsCore,代码行数:15,代码来源:module.php
示例16: __construct
/**
* Constructor
*
* @param string $caption
* @param string $name
* @param mixed $value Pre-selected value (or array of them).
* @param int $size Number or rows. "1" makes a drop-down-list
* @param bool $theme_set_allowed Flag to use only selectable theme
*/
public function __construct($caption, $name, $value = null, $size = 1, $theme_set_allowed = false)
{
parent::__construct($caption, $name, $value, $size);
if ($theme_set_allowed === false) {
$this->addOptionArray(XoopsLists::getThemesList());
} else {
$theme_arr = $GLOBALS['xoopsConfig']['theme_set_allowed'];
foreach (array_keys($theme_arr) as $i) {
$this->addOption($theme_arr[$i], $theme_arr[$i]);
}
}
}
开发者ID:geekwright,项目名称:XoopsCore25,代码行数:21,代码来源:formselecttheme.php
示例17: render
function render()
{
if ($this->section == 'GUI') {
$dirs = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/modules/rmcommon/themes', '');
} else {
$dirs = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . '/themes', '');
}
$themes = array();
foreach ($dirs as $dir => $v) {
if ($this->section == 'GUI') {
if (!file_exists(XOOPS_ROOT_PATH . '/modules/rmcommon/themes/' . $dir . '/admin-gui.php')) {
continue;
}
} else {
if (!file_exists(XOOPS_ROOT_PATH . '/themes/' . $dir . '/theme.html')) {
continue;
}
}
// Read theme name
$file = file_get_contents(XOOPS_ROOT_PATH . '/modules/rmcommon/themes/' . $dir . '/admin-gui.php');
preg_match("/Theme name:\\s{0,}(.*)?\n/m", $file, $name);
$themes[$dir] = isset($name[1]) ? $name[1] : __('Unknow', 'rmcommon');
}
unset($name);
if ($this->type) {
$rtn = '<ul class="rmoptions_container">';
foreach ($themes as $k => $name) {
if ($this->multi) {
$rtn .= "<li><label><input type='checkbox' value='{$k}' name='" . $this->getName() . "[]' id='" . $this->id() . "'" . (is_array($this->selected) ? in_array($k, $this->selected) ? " checked='checked'" : '' : '') . " /> {$name}</label></li>";
} else {
$rtn .= "<li><label><input type='radio' value='{$k}' name='" . $this->getName() . "' id='" . $this->id() . "'" . (!empty($this->selected) ? $k == $this->selected ? " checked='checked'" : '' : '') . " /> {$name}</label></li>";
}
}
$rtn .= "</ul>";
} else {
if ($this->multi) {
$rtn = "<select name='" . $this->getName() . "[]' id='" . $this->id() . "' size='6' multiple='multiple' class=\"form-control " . $this->getClass() . "\">";
foreach ($themes as $k => $name) {
$rtn .= "<option value='{$k}'" . (is_array($this->selected) ? in_array($k, $this->selected) ? " selected='selected'" : '' : '') . ">{$name}</option>";
}
$rtn .= "</select>";
} else {
$rtn = "<select name='" . $this->getName() . "' id='" . $this->id() . "' class=\"form-control " . $this->getClass() . "\">";
foreach ($themes as $k => $name) {
$rtn .= "<option value='{$k}'" . (!empty($this->selected) ? $k == $this->selected ? " selected='selected'" : '' : '') . ">{$name}</option>";
}
$rtn .= "</select>";
}
}
return $rtn;
}
开发者ID:JustineBABY,项目名称:rmcommon,代码行数:51,代码来源:theme.class.php
示例18: getForm
/**
* @param bool $action
* @return XoopsThemeForm
*/
public function getForm($action = false)
{
global $xoopsDB, $xoopsModuleConfig;
if ($action === false) {
$action = $_SERVER['REQUEST_URI'];
}
$title = $this->isNew() ? sprintf(_AM_PRESENTER_CAT_ADD) : sprintf(_AM_PRESENTER_CAT_EDIT);
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$form = new XoopsThemeForm($title, 'form', $action, 'post', true);
$form->setExtra('enctype="multipart/form-data"');
// Cat_pid
include_once XOOPS_ROOT_PATH . '/class/tree.php';
$categoriesHandler =& xoops_getModuleHandler('categories', 'presenter');
$criteria = new CriteriaCompo();
$categories = $categoriesHandler->getObjects($criteria);
if ($categories) {
$categories_tree = new XoopsObjectTree($categories, 'cat_id', 'cat_pid');
$cat_pid = $categories_tree->makeSelBox('cat_pid', 'cat_title', '--', $this->getVar('cat_pid', 'e'), false);
$form->addElement(new XoopsFormLabel(_AM_PRESENTER_CAT_PID, $cat_pid));
}
// Cat_title
$form->addElement(new XoopsFormText(_AM_PRESENTER_CAT_TITLE, 'cat_title', 50, 255, $this->getVar('cat_title')), true);
// Cat_desc
$form->addElement(new XoopsFormTextArea(_AM_PRESENTER_CAT_DESC, 'cat_desc', $this->getVar('cat_desc'), 4, 47), true);
// Cat_image
$cat_image = $this->getVar('cat_image') ? $this->getVar('cat_image') : 'blank.gif';
$uploadir = '/uploads/presenter/images/categories';
$imgtray = new XoopsFormElementTray(_AM_PRESENTER_CAT_IMAGE, '<br />');
$imgpath = sprintf(_AM_PRESENTER_FORMIMAGE_PATH, $uploadir);
$imageselect = new XoopsFormSelect($imgpath, 'cat_image', $cat_image);
$image_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $uploadir);
foreach ($image_array as $image) {
$imageselect->addOption("{$image}", $image);
}
$imageselect->setExtra("onchange='showImgSelected(\"image_cat_image\", \"cat_image\", \"" . $uploadir . "\", \"\", \"" . XOOPS_URL . "\")'");
$imgtray->addElement($imageselect);
$imgtray->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . "/" . $uploadir . "/" . $cat_image . "' name='image_cat_image' id='image_cat_image' alt='' />"));
$fileseltray = new XoopsFormElementTray('', '<br />');
$fileseltray->addElement(new XoopsFormFile(_AM_PRESENTER_FORMUPLOAD, 'cat_image', $xoopsModuleConfig['maxsize']));
$fileseltray->addElement(new XoopsFormLabel(''));
$imgtray->addElement($fileseltray);
$form->addElement($imgtray);
// Cat_weight
$form->addElement(new XoopsFormText(_AM_PRESENTER_CAT_WEIGHT, 'cat_weight', 50, 255, $this->getVar('cat_weight')), false);
// Cat_color
// $form->addElement(new XoopsFormColorPicker(_AM_PRESENTER_CAT_COLOR, 'cat_color', $this->getVar('cat_color')), false);
$form->addElement(new XoopsFormHidden('op', 'save'));
$form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
return $form;
}
开发者ID:mambax7,项目名称:presenter,代码行数:54,代码来源:categories.php
示例19: editCategory
/**
* editCategory()
*
* @param integer $catid
* @return
*/
function editCategory($category_obj = null)
{
global $xoopsModule;
$category_handler =& xoops_getmodulehandler('category', 'newbb');
if (empty($category_obj)) {
$category_obj =& $category_handler->create();
}
$groups_cat_access = null;
include_once XOOPS_ROOT_PATH . "/modules/" . $xoopsModule->getVar("dirname") . "/class/xoopsformloader.php";
if (!$category_obj->isNew()) {
$sform = new XoopsThemeForm(_AM_NEWBB_EDITCATEGORY . " " . $category_obj->getVar('cat_title'), "op", xoops_getenv('PHP_SELF'));
} else {
$sform = new XoopsThemeForm(_AM_NEWBB_CREATENEWCATEGORY, "op", xoops_getenv('PHP_SELF'));
$category_obj->setVar('cat_title', '');
$category_obj->setVar('cat_image', '');
$category_obj->setVar('cat_description', '');
$category_obj->setVar('cat_order', 0);
$category_obj->setVar('cat_url', 'http://www.myxoops.org myXOOPS Support');
}
$sform->addElement(new XoopsFormText(_AM_NEWBB_SETCATEGORYORDER, 'cat_order', 5, 10, $category_obj->getVar('cat_order')), false);
$sform->addElement(new XoopsFormText(_AM_NEWBB_CATEGORY, 'title', 50, 80, $category_obj->getVar('cat_title', 'E')), true);
$sform->addElement(new XoopsFormDhtmlTextArea(_AM_NEWBB_CATEGORYDESC, 'cat_description', $category_obj->getVar('cat_description', 'E'), 10, 60), false);
$imgdir = "/modules/" . $xoopsModule->getVar("dirname") . "/images/category";
$cat_image = $category_obj->getVar("cat_image");
$cat_image = empty($cat_image) ? 'blank.gif' : $cat_image;
$graph_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . $imgdir . "/");
array_unshift($graph_array, _NONE);
$cat_image_select = new XoopsFormSelect('', 'cat_image', $category_obj->getVar('cat_image'));
$cat_image_select->addOptionArray($graph_array);
$cat_image_select->setExtra("onchange=\"showImgSelected('img', 'cat_image', '/" . $imgdir . "/', '', '" . XOOPS_URL . "')\"");
$cat_image_tray = new XoopsFormElementTray(_AM_NEWBB_IMAGE, ' ');
$cat_image_tray->addElement($cat_image_select);
$cat_image_tray->addElement(new XoopsFormLabel('', "<br /><img src='" . XOOPS_URL . $imgdir . "/" . $cat_image . " 'name='img' id='img' alt='' />"));
$sform->addElement($cat_image_tray);
$sform->addElement(new XoopsFormText(_AM_NEWBB_SPONSORLINK, 'cat_url', 50, 80, $category_obj->getVar('cat_url', 'E')), false);
$sform->addElement(new XoopsFormHidden('cat_id', $category_obj->getVar("cat_id")));
$button_tray = new XoopsFormElementTray('', '');
$button_tray->addElement(new XoopsFormHidden('op', 'save'));
$butt_save = new XoopsFormButton('', '', _SUBMIT, 'submit');
$butt_save->setExtra('onclick="this.form.elements.op.value=\'save\'"');
$button_tray->addElement($butt_save);
if ($category_obj->getVar("cat_id")) {
$butt_delete = new XoopsFormButton('', '', _CANCEL, 'submit');
$butt_delete->setExtra('onclick="this.form.elements.op.value=\'default\'"');
$button_tray->addElement($butt_delete);
}
$sform->addElement($button_tray);
$sform->display();
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:55,代码来源:admin_cat_manager.php
|
请发表评论