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; } } } }
/** * expects an array of array containing: * name, Name of the submenu * url, Url of the submenu relative to the module * ex: return array(0 => array( * 'name' => _MI_PUBLISHER_SUB_SMNAME3; * 'url' => "search.php"; * )); * * @return array */ public function subMenus() { $ret = array(); $files = XoopsLists::getFileListAsArray(dirname(dirname(__DIR__))); $i = 0; foreach ($files as $file) { if (!in_array($file, array('xoops_version.php', 'index.php'))) { $fileName = ucfirst(str_replace('.php', '', $file)); $ret[$i]['name'] = $fileName; $ret[$i]['url'] = $file; ++$i; } } return $ret; }
function getPluginsArray() { include_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; $aFiles = XoopsLists::getFileListAsArray(SMARTCLONE_ROOT_PATH . 'plugins/'); $ret = array(); foreach ($aFiles as $file) { if (substr($file, strlen($file) - 4, 4) == '.php') { $pluginName = str_replace('.php', '', $file); $module_xoops_version_file = XOOPS_ROOT_PATH . "/modules/{$pluginName}/xoops_version.php"; if (file_exists($module_xoops_version_file)) { $ret[$pluginName] = $pluginName; } } } return $ret; }
/** * Used to populate backend * * @param int $limit : Number of item for backend * * Expects an array containing: * title : Title for the backend items * link : Link for the backend items * content : content for the backend items * date : Date of the backend items * * @return array */ public function backend($limit) { $xoops = Xoops::getInstance(); $i = 0; $ret = array(); $files = XoopsLists::getFileListAsArray($xoops->path('modules/codex/')); foreach ($files as $file) { if (!in_array($file, array('xoops_version.php', 'index.php'))) { $ret[$i]['title'] = ucfirst(str_replace('.php', '', $file)); $ret[$i]['link'] = $xoops->url('modules/codex/' . $file); $ret[$i]['content'] = 'Codex module : ' . ucfirst(str_replace('.php', '', $file)); $ret[$i]['date'] = filemtime($xoops->path('modules/codex/' . $file)); ++$i; } } return $ret; }
public function search($queries, $andor, $limit, $start, $uid) { $queries = implode(' ', (array) $queries); $files = XoopsLists::getFileListAsArray(dirname(dirname(__DIR__))); $res = array(); $i = 0; foreach ($files as $file) { if (!in_array($file, array('xoops_version.php', 'index.php'))) { $fileName = ucfirst(str_replace('.php', '', $file)); if (stripos($fileName, $queries) !== false) { $res[$i]['link'] = $file; $res[$i]['title'] = $fileName; ++$i; } } } return $res; }
/** * Get available preloads information and set them to go! * * @return void */ function setPreloads() { //$modules_list = XoopsLists::getDirListAsArray(XOOPS_ROOT_PATH . "/modules/"); if ($modules_list = XoopsCache::read('system_modules_active')) { $i = 0; foreach ($modules_list as $module) { if (is_dir($dir = XOOPS_ROOT_PATH . "/modules/{$module}/preloads/")) { $file_list = XoopsLists::getFileListAsArray($dir); foreach ($file_list as $file) { if (preg_match('/(\\.php)$/i', $file)) { $file = substr($file, 0, -4); $this->_preloads[$i]['module'] = $module; $this->_preloads[$i]['file'] = $file; $i++; } } } } } }
function render() { $files = XoopsLists::getFileListAsArray(XOOPS_ROOT_PATH . '/modules/rmcommon/lang', ''); $langs = array(); $langs['en_US'] = 'en'; foreach ($files as $file => $v) { if (substr($file, -3) != '.mo') { continue; } $langs[substr($file, 0, -3)] = substr($file, 0, -3); } if ($this->type) { $rtn = '<div class="' . ($this->multi ? 'checkbox' : 'radio') . '"><ul class="rmoptions_container">'; $i = 1; foreach ($langs as $k) { 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'" : '' : '') . " /> {$k}</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'" : '' : '') . " /> {$k}</label></li>"; } $i++; } $rtn .= "</ul></div>"; } else { if ($this->multi) { $rtn = "<select name='" . $this->getName() . "[]' id='" . $this->id() . "[]' size='{$this->cols}' multiple='multiple' class=\"form-control " . $this->getClass() . "\">"; foreach ($langs as $k) { $rtn .= "<option value='{$k}'" . (is_array($this->selected) ? in_array($k, $this->selected) ? " selected='selected'" : '' : '') . ">{$k}</option>"; } $rtn .= "</select>"; } else { $rtn = "<select name='" . $this->getName() . "' id='" . $this->id() . "' class=\"form-control " . $this->getClass() . "\">"; foreach ($langs as $k) { $rtn .= "<option value='{$k}'" . (!empty($this->selected) ? $k == $this->selected ? " selected='selected'" : '' : '') . ">{$k}</option>"; } $rtn .= "</select>"; } } return $rtn; }
function getPluginsArray() { include_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; $module_handler = xoops_gethandler('module'); $criteria = new CriteriaCompo(); $criteria->add(new Criteria('isactive', 1)); $tempModulesObj = $module_handler->getObjects($criteria); $modulesObj = array(); foreach ($tempModulesObj as $moduleObj) { $modulesObj[$moduleObj->getVar('dirname')] = $moduleObj; } $aFiles = XoopsLists::getFileListAsArray(SMARTOBJECT_ROOT_PATH . 'plugins/'); $ret = array(); foreach ($aFiles as $file) { if (substr($file, strlen($file) - 4, 4) == '.php') { $pluginName = str_replace('.php', '', $file); $module_xoops_version_file = XOOPS_ROOT_PATH . "/modules/{$pluginName}/xoops_version.php"; if (file_exists($module_xoops_version_file) && isset($modulesObj[$pluginName])) { $ret[$pluginName] = $modulesObj[$pluginName]->getVar('name'); } } } return $ret; }
function cache_delete_expired() { global $xoopsSecurity; if (!$xoopsSecurity->check()) { redirectMsg('plugins.php?p=booster&action=view', __('Session token expired!', 'booster'), 1); die; } $plugin = RMFunctions::get()->load_plugin('booster'); $items = XoopsLists::getFileListAsArray(XOOPS_CACHE_PATH . '/booster/files'); $files = array(); foreach ($items as $file) { $tmp = explode('.', $file); if ($tmp[1] != 'meta') { continue; } $content = json_decode(file_get_contents(XOOPS_CACHE_PATH . '/booster/files/' . $file), true); if (time() - $content['created'] >= $plugin->get_config('time')) { @unlink(XOOPS_CACHE_PATH . '/booster/files/' . $file); @unlink(XOOPS_CACHE_PATH . '/booster/files/' . $tmp[0] . '.html'); } } redirectMsg('plugins.php?p=booster&action=view', __('Expired pages deleted successfully', 'boost'), 0); die; }
/** * Get a list of extensions * * @param string $name name of captcha looking for * @param string $extension extentions for captcha * * @return array|mixed */ public function getList($name, $extension = "") { if ($items = Xoops_Cache::read("captcha_captcha_{$name}")) { return $items; } $file_path = $this->xoops_root_path . "/class/captcha/image/{$name}"; $files = XoopsLists::getFileListAsArray($file_path); foreach ($files as $item) { if (empty($extension) || preg_match("/(\\.{$extension})\$/i", $item)) { $items[] = $item; } } Xoops_Cache::write("captcha_captcha_{$name}", $items); return $items; }
$modversion['tables'][7] = 'rmc_blocks_positions'; $modversion['tables'][8] = 'rmc_bkmod'; // Templates $modversion['templates'][1]['file'] = 'rmc_comments_display.html'; $modversion['templates'][1]['description'] = 'Comments list'; $modversion['templates'][2]['file'] = 'rmc_comments_form.html'; $modversion['templates'][2]['description'] = 'Shows the comments form'; /** * Language */ $modversion['config'][1]['name'] = 'lang'; $modversion['config'][1]['title'] = '_MI_RMC_LANG'; $modversion['config'][1]['description'] = ''; $modversion['config'][1]['formtype'] = 'select'; $modversion['config'][1]['valuetype'] = 'text'; $files = XoopsLists::getFileListAsArray(XOOPS_ROOT_PATH . '/modules/rmcommon/lang', ''); $options = array(); $options['en_US'] = 'en'; foreach ($files as $file => $v) { if (substr($file, -3) != '.mo') { continue; } $options[substr($file, 0, -3)] = substr($file, 0, -3); } $modversion['config'][1]['default'] = 'en'; $modversion['config'][1]['options'] = $options; // Update config options $fct = isset($_GET['fct']) ? $_GET['fct'] : ''; $mid = isset($_GET['mod']) ? $_GET['mod'] : ''; $mh = xoops_gethandler('module'); $mod = $mh->getByDirname('rmcommon');
<?php /* You may not change or alter any portion of this comment or credits of supporting developers from this source code or any supporting source code which is considered copyrighted (c) material of the original comment or credit authors. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ /** * @copyright XOOPS Project (http://xoops.org) * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) * @author trabis <*****@*****.**> * @version $Id$ */ include dirname(dirname(__DIR__)) . '/mainfile.php'; $xoops = Xoops::getInstance(); $xoops->header(); $files = XoopsLists::getFileListAsArray(__DIR__); foreach ($files as $file) { if (!in_array($file, array('xoops_version.php', 'index.php'))) { $fileName = ucfirst(str_replace('.php', '', $file)); echo "<a href={$file}>{$fileName}</a><br/>"; } } $xoops->footer();
/** * Get list of all available preload files * * @return void */ protected function setPreloads() { $cache = \Xoops::getInstance()->cache(); $key = 'system/modules/preloads'; if (!($this->preloadList = $cache->read($key))) { // get active modules from the xoops instance $modules_list = \Xoops::getInstance()->getActiveModules(); if (empty($modules_list)) { // this should only happen if an exception was thrown in setActiveModules() $modules_list = array('system'); } $this->preloadList = array(); $i = 0; foreach ($modules_list as $module) { if (is_dir($dir = \XoopsBaseConfig::get('root-path') . "/modules/{$module}/preloads/")) { $file_list = \XoopsLists::getFileListAsArray($dir); foreach ($file_list as $file) { if (preg_match('/(\\.php)$/i', $file)) { $file = substr($file, 0, -4); $this->preloadList[$i]['module'] = $module; $this->preloadList[$i]['file'] = $file; ++$i; } } } } $cache->write($key, $this->preloadList); } }
$other_menu = RMEvents::get()->run_event('twop6.other.menu'); // Left Widgets $left_widgets = array(); $left_widgets = RMEvents::get()->run_event('rmcommon.load.left.widgets', $left_widgets); // Right widgets $right_widgets = array(); $right_widgets = RMEvents::get()->run_event('rmcommon.load.right.widgets', $right_widgets); $tp6Span = 12; if ($left_widgets) { $tp6Span -= 2; } if ($right_widgets) { $tp6Span -= 3; } /* Load color schemes */ $files = XoopsLists::getFileListAsArray(TWOP6_PATH . '/css/schemes'); $color_schemes = array(); foreach ($files as $scheme) { $content_color = file_get_contents(TWOP6_PATH . '/css/schemes/' . $scheme, null, null, null, 100); $info_color = array(); preg_match("/^\\/\\*\\s(.*)\\s\\*\\//s", $content_color, $info_color); if (isset($info_color[1]) && $info_color[1] != '') { $color_schemes[$scheme] = $info_color[1]; } } unset($content_color, $info_color); $this->add_style('bootstrap.min.css', 'rmcommon'); $this->add_style('general.min.css', 'rmcommon', array()); $this->add_style('2.6.css', 'twop6', array(), 'theme'); $color_scheme = isset($_COOKIE['color_scheme']) ? $_COOKIE['color_scheme'] : 'theme-default.css'; $this->add_style('schemes/' . $color_scheme, 'twop6', array('id' => 'color-scheme'), 'theme');
if ($command == "delete") { $xoopsTpl->assign('lid', $lid); $xoopsTpl->assign('filename', $filename); $xoopsTpl->assign('deleteok', sprintf(_MD_DELETEFILE, $filename)); } if ($command == "deleteok") { $fullpath = XOOPS_ROOT_PATH . UPLOADS . "/" . $filename; if (extension_loaded('mbstring')) { $fullpath = mb_convert_encoding($fullpath, $xoopsModuleConfig['filename_code'], mb_internal_encoding()); } if (is_file($fullpath)) { unlink($fullpath); } } } $file_array = XoopsLists::getFileListAsArray($dir_src); $files = 0; $per_page = $xoopsModuleConfig['perpage']; $flist = array(); foreach ($file_array as $file) { $d = new download($file); if (!preg_match("/^\\./", $d->fnameToDwonload)) { $info = array(); $info['name'] = $d->fnameToDwonload; $info['size'] = filesize($dir_src . "/" . $file); $info['type'] = $d->contentType; $info['date'] = date("Y/m/d H:i", filemtime($dir_src . "/" . $file)); $flist[] = $info; $files++; } }
function editgenre() { require_once XOOPS_ROOT_PATH . '/class/template.php'; if (!isset($xoopsTpl)) { $xoopsTpl = new XoopsTpl(); } global $xoopsDB, $genrecat, $xoopsModuleConfig, $xoopsModule; $sql = "SELECT genreid, subgenreid, genretitle, imgurl, catweight FROM " . $xoopsDB->prefix('debaser_genre') . " WHERE genreid=" . intval($_GET['genreid']) . ""; $result = $xoopsDB->query($sql); list($genreid, $subgenreid, $genretitle, $imgurl, $catweight) = $xoopsDB->fetchRow($result); $member_handler =& xoops_gethandler('member'); $group_list =& $member_handler->getGroupList(); $gperm_handler =& xoops_gethandler('groupperm'); $groups = $gperm_handler->getGroupIds('DebaserCatPerm', $genreid, $xoopsModule->getVar('mid')); $groups = $groups; $edform = new XoopsThemeForm(_AM_DEBASER_EDITGENRE, "editgenre", "category.php"); if ($xoopsModuleConfig['usecatperm'] == 1) { $edform->addElement(new XoopsFormSelectGroup(_AM_DEBASER_FCATEGORY_GROUPPROMPT, "groups", true, $groups, 5, true)); } $formgenrename = new XoopsFormText(_AM_DEBASER_GENRE, "genrenew", 50, 50, $genretitle); if ($subgenreid == 0) { $graph_array =& XoopsLists::getFileListAsArray(XOOPS_ROOT_PATH . "/" . $xoopsModuleConfig['catimage']); $indeximage_select = new XoopsFormSelect('', 'imgurl', $imgurl); $indeximage_select->addOption('', '----------'); $indeximage_select->addOptionArray($graph_array); $indeximage_select->setExtra("onchange='showImgSelected(\"image\", \"imgurl\", \"" . $xoopsModuleConfig['catimage'] . "\", \"\", \"" . XOOPS_URL . "\")'"); $indeximage_tray = new XoopsFormElementTray(_AM_DEBASER_FCATEGORY_CIMAGE, ' '); $indeximage_tray->addElement($indeximage_select); if (!empty($imgurl)) { $indeximage_tray->addElement(new XoopsFormLabel('', "<br /><br /><img src='" . XOOPS_URL . "/" . $xoopsModuleConfig['catimage'] . "/" . $imgurl . "' name='image' id='image' alt='' />")); } else { $indeximage_tray->addElement(new XoopsFormLabel('', "<br /><br /><img src='" . XOOPS_URL . "/uploads/blank.gif' name='image' id='image' alt='' />")); } } $formgenreweight = new XoopsFormText(_AM_DEBASER_WEIGHT, 'catweight', 4, 4, $catweight); $op_hidden = new XoopsFormHidden("op", "editgenresave"); $genreid_hidden = new XoopsFormHidden('genreid', $genreid); $genrecat_hidden = new XoopsFormHidden('genrecat', $genretitle); $submit_button = new XoopsFormButton("", "dbsubmit", _SUBMIT, "submit"); $edform->addElement($formgenrename); $edform->addElement($indeximage_tray); $edform->addElement($formgenreweight); $edform->addElement($op_hidden); $edform->addElement($genreid_hidden); $edform->addElement($genrecat_hidden); $edform->addElement($submit_button); $xoopsTpl->assign('editgenre', $edform->render()); $xoopsTpl->assign('genrecat', $genrecat); $xoopsTpl->assign('adminmenu', debaseradminMenu(2, _AM_DEBASER_EDITGENRE . ' : ' . $genretitle)); $xoopsTpl->display('db:debaser_ameditgenre.html'); }
function proc_save() { global $error_flag; $dir_src = $_POST['dir_src']; $dir_image = $_POST['dir_image']; $filter = $_POST['filter']; $flag_image = $_POST['image']; $flag_copy = $_POST['image_copy']; $flag_test = $_POST['test']; $dir_image_full = XOOPS_ROOT_PATH . $dir_image; // test mode if ($flag_test) { echo "<hr>";} if ( !file_exists($dir_src) ) { echo "<font color=red>"._AM_IMPORT_ERRDIREXI."</font><br>$dir_src<br>\n"; return; } if ($filter) { if ( !file_exists($filter) ) { echo "<font color=red>"._AM_IMPORT_ERRFILEXI."</font><br>$filter<br>\n"; return; } if ( !is_executable($filter) ) { echo "<font color=red>"._AM_IMPORT_ERRFILEXEC."</font><br>$filter<br>\n"; return; } } if ($flag_image) { if (!$flag_copy) { echo "<font color=red>"._AM_IMPORT_ERRNOCOPY."</font><br>\n"; return; } if (!$dir_image) { echo "<font color=red>"._AM_IMPORT_ERRNOIMGDIR."</font><br>\n"; return; } if ( file_exists($dir_image_full) && !is_dir($dir_image_full) ) { echo "<font color=red>"._AM_IMPORT_ERRIMGDIREXI."</font><br>$dir_image_full<br>\n"; return; } } echo "<table><tr><td>\n"; if ( is_dir($dir_src) ) { $file_array = XoopsLists::getFileListAsArray($dir_src); $dir = dir_name($dir_src); foreach ($file_array as $file) { file_proc("$dir/$file"); } } else { file_proc($dir_src); } echo "</td></tr></table><br>\n"; // test mode if ($flag_test) { echo "<hr>\n"; echo "<a href=\"JavaScript:history.back()\">"._AM_IMPORT."</a>"; } elseif($error_flag) { echo "<hr>\n"; echo "<font color=red>unsuccessful !!</font><br><br>\n"; echo "<a href=\"allarticles.php\">"._AM_ARTICLEMANAGE."</a><br>"; echo "<a href=\"JavaScript:history.back()\">"._AM_IMPORT."</a>"; } else { echo "<hr>\n"; echo "<b>"._AM_DBUPDATED."</b><br><br>\n"; echo "<a href=\"allarticles.php\">"._AM_ARTICLEMANAGE."</a>"; } }
/** * Clean cached files */ public function delete_expired() { $items = XoopsLists::getFileListAsArray(XOOPS_CACHE_PATH . '/booster/files'); $files = array(); foreach ($items as $file) { $tmp = explode('.', $file); if ($tmp[1] != 'meta') { continue; } $content = json_decode(file_get_contents(XOOPS_CACHE_PATH . '/booster/files/' . $file), true); if (time() - $content['created'] >= $this->get_config('time')) { @unlink(XOOPS_CACHE_PATH . '/booster/files/' . $file); @unlink(XOOPS_CACHE_PATH . '/booster/files/' . $tmp[0] . '.html'); } } }
function editform() { global $xoopsModule, $HTTP_SERVER_VARS, $HTTP_POST_VARS, $groupid, $myts, $xoopsConfig, $xoopsUser, $xoopsDB, $textareaname, $wfsConfig; include XOOPS_ROOT_PATH . "/include/xoopscodes.php"; $textareaname = ''; //$maintext = ''; echo "<table width='100%' border='0' cellspacing='0' cellpadding='1'>"; echo "<table><tr><td><form action='index.php' method='post' name='coolsus'>"; echo "<div><b>" . _AM_GROUPPROMPT . "</b><br />"; if (isset($this->groupid)) { listGroups($this->groupid); } else { listGroups(); } echo "<br />"; echo "</div><br />"; echo "<div><b>" . _WFS_CATEGORY . "</b><br>"; $xt = new WfsCategory(); if (isset($this->categoryid)) { $xt->makeSelBox(0, $this->categoryid, "categoryid"); } else { $xt->makeSelBox(0, 0, "categoryid"); } echo "</div><br />"; echo "<div><b>" . _AM_ARTICLEWEIGHT . "</b><br />"; echo "<input type='text' name='weight' id='weight' value='"; if (isset($this->weight)) { echo $this->weight("F"); } else { $this->weight = 0; echo $this->weight("F"); } echo "' size='5' /></div><br>"; echo "<div>" . _WFS_CAUTH . "<br></div>"; echo "<div><select name='changeuser'>"; echo "<option value='-1'>------</option>"; $result = $xoopsDB->query("SELECT uid, uname FROM " . $xoopsDB->prefix("users") . " ORDER BY uname"); while (list($uid, $uname) = $xoopsDB->fetchRow($result)) { if ($uid == $this->uid) { $opt_selected = "selected='selected'"; } else { $opt_selected = ""; } echo "<option value='" . $uid . "' {$opt_selected}>" . $uname . "</option>"; } echo "</select></div><br />"; echo "<div><b>" . _WFS_TITLE . "</b><br />"; echo "<input type='text' name='title' id='title' value='"; if (isset($this->title)) { if ($this->titleFlag) { echo $this->title("F"); } else { echo $this->title("E"); } } echo "' size='50' /></div><br />"; //HTML Page Seclection// echo "<div><b>" . _WFS_HTMLPAGE . "</b></div>"; //echo " <b>HTML Path: </b>".$htmlpath."<br /><br /></div>"; $html_array = XoopsLists::getFileListAsArray(XOOPS_ROOT_PATH . '/' . $wfsConfig['htmlpath']); echo "<div><select size='1' name='htmlpage'>"; echo "<option value=' '>------</option>"; foreach ($html_array as $htmlpage) { if ($htmlpage == $this->htmlpage()) { $opt_selected = "selected='selected'"; } else { $opt_selected = ""; } echo "<option value='" . $htmlpage . "' {$opt_selected}>" . $htmlpage . "</option>"; } echo "</select>"; $htmlpath = XOOPS_ROOT_PATH . '/' . $wfsConfig['htmlpath']; echo " <b>HTML Path: </b>" . $htmlpath . "<br /><br /></div>"; //echo "</div><br />"; echo "<div><b>" . _WFS_MAINTEXT . "</b></div>"; if (isset($this->maintext)) { if ($this->maintextFlag) { $GLOBALS['maintext'] = $this->maintext("F"); } else { $GLOBALS['maintext'] = $this->maintext("E"); } } if (!strstr($HTTP_SERVER_VARS["HTTP_USER_AGENT"], "MSIE")) { $wfsConfig['wysiwygeditor'] = '0'; } if ($wfsConfig['wysiwygeditor'] == '1') { html_editor('maintext'); $smiliepath = $wfsConfig['smiliepath']; $smilie_array = XoopsLists::getimgListAsArray(XOOPS_ROOT_PATH . "/" . $smiliepath); echo "<br /><div style='text-align: left;'><b>" . _AM_SMILIE . "</b><br />"; echo "<table><tr><td align='top' valign='left'>"; echo "<div><script type='text/javascript'>\n\t\t<!--\n\t\t\tfunction showbutton() {\n\t\t\t \tdocument.all." . $textareaname . "_mysmile.src = '" . $xoopsConfig['xoops_url'] . "/{$smiliepath}/' + document.all." . $textareaname . "_smiley.value;\n\t\t\t}\n\t\t// -->\n\t\t</script>"; echo "<select name='" . $textareaname . "_smiley' onchange='showbutton();'>"; foreach ($smilie_array as $file) { echo "<option value='" . $file . "' {$opt_selected}>" . $file . "</option>"; } echo "</select></td><td align='top' valign='left'>"; echo "<img name='" . $textareaname . "_mysmile' src='" . $xoopsConfig['xoops_url'] . "/{$smiliepath}/{$file}' style='cursor:hand;' border='0' onclick=\"doFormat('InsertImage', document.all." . $textareaname . "_mysmile.src);\" />"; echo "</td></tr></table>\n\t\t<script type='text/javascript'>\n\t\t\tshowbutton();\n\t\t</script>"; //Start of article images $graphpath = $wfsConfig['graphicspath']; $graph_array =& XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH . "/" . $graphpath); echo "<br><div style='text-align: left;'><b>" . _AM_GRAPHIC . "</b><br />"; echo "<table><tr><td align='top' valign='left'>"; echo "<script type='text/javascript'>\n\t\t<!--\n\t\t\tfunction showbutton2() {\n\t\t\t\tdocument.all." . $textareaname . "_mygraph.src = '" . $xoopsConfig['xoops_url'] . "/{$graphpath}/' + document.all." . $textareaname . "_graph.value;\n\t\t\t}\n\t\t// -->\n\t\t</script>"; echo "<select name='" . $textareaname . "_graph' onchange='showbutton2();'>"; foreach ($graph_array as $file2) { echo "<option value='" . $file2 . "' {$opt_selected}>" . $file2 . "</option>"; } echo "</select></td><td align='top' valign='left'>"; echo "<img name='" . $textareaname . "_mygraph' src='" . $xoopsConfig['xoops_url'] . "/{$graphpath}/{$file2}' style='cursor:hand;' border='0' onclick=\"doFormat('InsertImage', document.all." . $textareaname . "_mygraph.src);\" />"; echo "</td></tr></table>\n\t\t<script type='text/javascript'>\n\t\t\tshowbutton2();\n\t\t</script>"; } else { xoopsCodeTarea("maintext", 60, 15); xoopsSmilies("maintext"); } echo "<div><b>" . _WFS_SUMMARY . "</b></div>"; echo "<div><textarea id='summary' name='summary' wrap='virtual' cols='60' rows='5'>"; if (isset($this->summary)) { if ($this->summaryFlag) { echo $this->summary("F"); } else { echo $this->summary("E"); } } echo "</textarea></div>"; echo "<div class = 'bg3'><h4>" . _WFS_ARTICLELINK . "</h4></div>"; echo "<div><b>" . _WFS_LINKURL . "</b><br />"; echo "<input type='text' name='url' id='url' value='"; if (isset($this->url)) { echo $this->url("F"); } echo "' size='70' /></div><br />"; echo "<div><b>" . _WFS_LINKURLNAME . "</b><br />"; echo "<input type='text' name='urlname' id='urlname' value='"; if (isset($this->urlname)) { echo $this->urlname("F"); } echo "' size='50' /></div><br>"; echo "<div class = 'bg3'><h4>" . _WFS_ATTACHEDFILES . "</h4></div>"; echo "<div>" . _WFS_ATTACHEDFILESTXT . "</div><br />"; if (empty($this->articleid)) { echo _WFS_AFTERREGED . "<br />"; } elseif ($num = $this->getFilesCount()) { echo "<table border='1' style='border-collapse: collapse' bordercolor='#ffffff' width='100%' >"; echo "<tr class='bg3'><td align='center'>" . _AM_FILEID . "</td><td align='center'>" . _AM_FILEICON . "</td><td align='center'>" . _AM_FILESTORE . "</td><td align='center'>" . _AM_REALFILENAME . "</td><td align='center'>" . _AM_USERFILENAME . "</td><td align='center' class='nw'>" . _AM_FILEMIMETYPE . "</td><td align='center' class='nw'>" . _AM_FILESIZE . "</td><td align='center'>" . _AM_ACTION . "</td></tr>"; foreach ($this->files as $attached) { if (is_file(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $attached->getFileRealName())) { $filename = $attached->getFileRealName(); } else { $filename = "File Error!"; } $fileid = $attached->getFileid(); $mimetype = new mimetype(); $icon = get_icon(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $filename); $iconshow = "<img src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/images/icon/" . $icon . " align='middle'>"; if (is_file(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $filename)) { $size = Prettysize(filesize(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $filename)); } else { $size = '0'; } $filerealname = $attached->downloadname; $mimeshow = $mimetype->getType(XOOPS_ROOT_PATH . "/" . $wfsConfig['filesbasepath'] . "/" . $filename); $counter = $attached->getCounter(); $linkedname = $attached->getFileShowName(); //$linkedname = $attached->getLinkedName(XOOPS_URL."/modules/".$xoopsModule->dirname()."/download.php?fileid="); $editlink = "<a href='index.php?op=fileedit&fileid=" . $fileid . "'>" . _AM_EDIT . "</a>"; $dellink = "<a href='index.php?op=delfile&fileid=" . $fileid . "'>" . _AM_DELETE . "</a>"; echo "<tr><td align='center'><b>" . $fileid . "</b>"; echo "</td><td align='center'>" . $iconshow . ""; echo "</td><td align='center'>" . $filename . ""; echo "</td><td align='center'>" . $filerealname . ""; echo "</td><td align='center'>" . $linkedname . ""; echo "</td><td align='center'>" . $mimeshow . ""; echo "</td><td align='center'>" . $size . ""; //echo "</td><td align='center' class='nw'>".$counter.""; echo "</td><td align='center'>" . $editlink . " " . $dellink . ""; echo "</td></tr>"; } echo "</table>"; } else { echo "<div align='left'>" . _WFS_NOFILE . "</div>"; } echo "</div><br />"; echo "<div class = 'bg3'><h4>" . _WFS_MISCSETTINGS . "</h4></div>"; echo "<input type='checkbox' name='autodate' value='1'"; if (isset($autodate) && $autodate == 1) { echo " checked='checked'"; } echo "> "; $time = time(); if (!empty($this->articleid)) { $isedit = 1; } if (isset($isedit) && $isedit == 1 && $this->published > $time) { echo "<b>" . _AM_CHANGEDATETIME . "</b><br /><br />"; printf(_AM_NOWSETTIME, formatTimestamp($this->published)); $published = xoops_getUserTimestamp($this->published); echo "<br /><br />"; printf(_AM_CURRENTTIME, formatTimestamp($time)); echo "<br />"; echo "<input type='hidden' name='isedit' value='1' />"; } else { echo "<b>" . _AM_SETDATETIME . "</b><br /><br />"; printf(_AM_CURRENTTIME, formatTimestamp($time)); echo "<br />"; } echo "<br /> " . _AM_MONTHC . " <select name='automonth'>"; if (isset($automonth)) { $automonth = intval($automonth); } elseif (isset($this->published)) { $automonth = date('m', $this->published); } else { $automonth = date('m'); } for ($xmonth = 1; $xmonth < 13; $xmonth++) { if ($xmonth == $automonth) { $sel = 'selected="selected"'; } else { $sel = ''; } echo "<option value='{$xmonth}' {$sel}>{$xmonth}</option>"; } echo "</select> "; echo _AM_DAYC . " <select name='autoday'>"; if (isset($autoday)) { $autoday = intval($autoday); } elseif (isset($published)) { $autoday = date('d', $this->published); } else { $autoday = date('d'); } for ($xday = 1; $xday < 32; $xday++) { if ($xday == $autoday) { $sel = 'selected="selected"'; } else { $sel = ''; } echo "<option value='{$xday}' {$sel}>{$xday}</option>"; } echo "</select> "; echo _AM_YEARC . " <select name='autoyear'>"; if (isset($autoyear)) { $autoyear = intval($autoyear); } elseif (isset($this->published)) { $autoyear = date('Y', $this->published); } else { $autoyear = date('Y'); } $cyear = date('Y'); for ($xyear = $autoyear - 8; $xyear < $cyear + 2; $xyear++) { if ($xyear == $autoyear) { $sel = 'selected="selected"'; } else { $sel = ''; } echo "<option value='{$xyear}' {$sel}>{$xyear}</option>"; } echo "</select>"; echo " " . _AM_TIMEC . " <select name='autohour'>"; if (isset($autohour)) { $autohour = intval($autohour); } elseif (isset($this->publishedshed)) { $autohour = date('H', $this->published); } else { $autohour = date('H'); } for ($xhour = 0; $xhour < 24; $xhour++) { if ($xhour == $autohour) { $sel = 'selected="selected"'; } else { $sel = ''; } echo "<option value='{$xhour}' {$sel}>{$xhour}</option>"; } echo "</select>"; echo " : <select name='automin'>"; if (isset($automin)) { $automin = intval($automin); } elseif (isset($published)) { $automin = date('i', $published); } else { $automin = date('i'); } for ($xmin = 0; $xmin < 61; $xmin++) { if ($xmin == $automin) { $sel = 'selected="selected"'; } else { $sel = ''; } $xxmin = $xmin; if ($xxmin < 10) { $xxmin = "{$xmin}"; } echo "<option value='{$xmin}' {$sel}>{$xxmin}</option>"; } echo "</select></br />"; echo "<br /><input type='checkbox' name='autoexpdate' value='1'"; if (isset($autoexpdate) && $autoexpdate == 1) { echo " checked='checked'"; } echo "> "; $time = time(); if (isset($isedit) && $isedit == 1 && $this->expired > 0) { echo "<b>" . _AM_CHANGEEXPDATETIME . "</b><br /><br />"; printf(_AM_NOWSETEXPTIME, formatTimestamp($this->expired)); echo "<br /><br />"; $expired = xoops_getUserTimestamp($this->expired); printf(_AM_CURRENTTIME, formatTimestamp($time)); echo "<br />"; echo "<input type='hidden' name='isedit' value='1' />"; } else { echo "<b>" . _AM_SETEXPDATETIME . "</b><br /><br />"; printf(_AM_CURRENTTIME, formatTimestamp($time)); echo "<br />"; } echo "<br /> " . _AM_MONTHC . " <select name='autoexpmonth'>"; if (isset($autoexpmonth)) { $autoexpmonth = intval($autoexpmonth); } elseif (isset($expired)) { $autoexpmonth = date('m', $expired); } else { $autoexpmonth = date('m'); $autoexpmonth = $autoexpmonth + 1; } for ($xmonth = 1; $xmonth < 13; $xmonth++) { if ($xmonth == $autoexpmonth) { $sel = 'selected="selected"'; } else { $sel = ''; } echo "<option value='{$xmonth}' {$sel}>{$xmonth}</option>"; } echo "</select> "; echo _AM_DAYC . " <select name='autoexpday'>"; if (isset($autoexpday)) { $autoexpday = intval($autoexpday); } elseif (isset($expired)) { $autoexpday = date('d', $expired); } else { $autoexpday = date('d'); } for ($xday = 1; $xday < 32; $xday++) { if ($xday == $autoexpday) { $sel = 'selected="selected"'; } else { $sel = ''; } echo "<option value='{$xday}' {$sel}>{$xday}</option>"; } echo "</select> "; echo _AM_YEARC . " <select name='autoexpyear'>"; if (isset($autoexpyear)) { $autoyear = intval($autoexpyear); } elseif (isset($expired)) { $autoexpyear = date('Y', $expired); } else { $autoexpyear = date('Y'); } $cyear = date('Y'); for ($xyear = $autoexpyear - 8; $xyear < $cyear + 2; $xyear++) { if ($xyear == $autoexpyear) { $sel = 'selected="selected"'; } else { $sel = ''; } echo "<option value='{$xyear}' {$sel}>{$xyear}</option>"; } echo "</select>"; echo " " . _AM_TIMEC . " <select name='autoexphour'>"; if (isset($autoexphour)) { $autoexphour = intval($autoexphour); } elseif (isset($expired)) { $autoexphour = date('H', $expired); } else { $autoexphour = date('H'); } for ($xhour = 0; $xhour < 24; $xhour++) { if ($xhour == $autoexphour) { $sel = 'selected="selected"'; } else { $sel = ''; } echo "<option value='{$xhour}' {$sel}>{$xhour}</option>"; } echo "</select>"; echo " : <select name='autoexpmin'>"; if (isset($autoexpmin)) { $autoexpmin = intval($autoexpmin); } elseif (isset($expired)) { $autoexpmin = date('i', $expired); } else { $autoexpmin = date('i'); } for ($xmin = 0; $xmin < 61; $xmin++) { if ($xmin == $autoexpmin) { $sel = 'selected="selected"'; } else { $sel = ''; } $xxmin = $xmin; if ($xxmin < 10) { $xxmin = "0{$xmin}"; } echo "<option value='{$xmin}' {$sel}>{$xxmin}</option>"; } echo "</select><br /><br />"; if (isset($this->published) && $this->published == 0 && isset($this->type) && $this->type == "user") { echo "<div><input type='checkbox' name='approved' value='1' checked='checked'> <b>" . _AM_APPROVE . "</b></div><br />"; } echo "<br /><div><input type='checkbox' name='nosmiley' value='1'"; if (isset($this->nosmiley) && $this->nosmiley == 1) { echo " checked='checked'"; } echo " /> <b>" . _WFS_DISAMILEY . "</b></div>"; echo "<div><input type='checkbox' name='nohtml' value='1'"; if (isset($this->nohtml) && $this->nohtml == 1) { echo " checked='checked'"; } echo " /> <b>" . _WFS_DISHTML . "</b><br />"; echo "</div><br />"; if (isset($isedit) && $isedit == 1) { echo "<input type='checkbox' name='movetotop' value='1'"; if (isset($movetotop) && $movetotop == 1) { echo " checked='checked'"; } echo " /> <b>" . _AM_MOVETOTOP . "</b><br />"; } echo "<br /><div><input type='checkbox' name='justhtml' value='2'"; if (isset($this->htmlpage) && $this->ishtml == '2') { echo " checked='checked'"; } echo " />" . _AM_JUSTHTML . "<br /></div>"; echo "<div><input type='checkbox' name='noshowart' value='1'"; if (isset($this->noshowart) && $this->noshowart == 1) { echo " checked='checked'"; } echo " /> " . _AM_NOSHOART . "<br />"; echo "</div><br />"; echo "<input type='checkbox' name='offline' value='1'"; if (isset($this->offline) && $this->offline == 1) { echo " checked='checked'"; } echo " /> " . _AM_OFFLINE . "<br />"; echo "<br />"; if (!empty($this->articleid)) { echo "<input type='hidden' name='articleid' value='" . $this->articleid . "' />\n"; } if (!empty($HTTP_POST_VARS['referer'])) { echo "<input type='hidden' name='referer' value='" . $HTTP_POST_VARS['referer'] . "' />\n"; } elseif (!empty($HTTP_SERVER_VARS['HTTP_REFERER'])) { echo "<input type='hidden' name='referer' value='" . $HTTP_SERVER_VARS['HTTP_REFERER'] . "' />\n"; } echo "<input type='submit' name='op' class='formButton' value='Preview' /> <input type='submit' name='op' class='formButton' value='Save' /> <input type='submit' name='op' class='formButton' value='Clean' />"; echo "</form>"; echo "</td></tr></table>"; if (!empty($this->articleid)) { echo "<hr />"; $upload = new UploadFile(); echo $upload->formStart("index.php?op=fileup"); echo "<h4>" . _WFS_FILEUPLOAD . "</h4>\n"; echo "" . _WFS_ATTACHFILEACCESS . "<br />"; echo "<br /><b>" . _WFS_ATTACHFILE . "</b><br />"; echo $upload->formMax(); echo $upload->formField(); echo "<br /><br /><b>" . _WFS_FILESHOWNAME . "</b><br />"; echo "<input type='text' name='fileshowname' id='fileshowname' value='"; if (isset($this->fileshowname)) { echo $this->fileshowname; } echo "' size='70' maxlength='80' /><br />"; echo "<br /><b>" . _WFS_FILEDESCRIPT . "</b><br />"; echo "<textarea name='textfiledescript' cols='50' rows='5'></textarea><br />"; echo "<br /><b>" . _WFS_FILETEXT . "</b><br />"; echo "<textarea name='textfilesearch' cols='50' rows='3'></textarea><br />"; echo "<input type='hidden' name='groupid' value='" . $this->groupip . "' />"; echo "<input type='hidden' name='articleid' value='" . $this->articleid . "' />"; echo "<input type='hidden' name='groupid' value= '" . $this->groupid . "' />"; echo $upload->formSubmit(_WFS_UPLOAD); echo $upload->formEnd(); } }
/** * Article management * * Export data * * @copyright The XOOPS project http://www.xoops.org/ * @license http://www.fsf.org/copyleft/gpl.html GNU public license * @author Taiwen Jiang (phppp or D.J.) <*****@*****.**> * @since 1.00 * @version $Id$ * @package module::article */ include 'header.php'; xoops_cp_header(); require_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; $files = XoopsLists::getFileListAsArray("."); $mods = array(); foreach ($files as $file => $filename) { list($mod, $ext) = explode(".", $file); if ($ext != "php" || $mod == "index" || $mod == "header") { continue; } $mods[$mod] = $file; } if (empty($_GET["module"]) || !isset($mods[$_GET["module"]])) { $form = "<h2>Select the module to export</h2>"; $form .= "<p>Note:\r\n\t\t<ul>\r\n\t\t<li>All current data in the selected module will be removed, make sure you understand it clearly!</li>\r\n\t\t<li>The scripts have NOT been fully tested with large volume data yet; if you find any problem, please help us improve.</li>\r\n\t\t</ul>\r\n\t\t</p>"; $form .= "<p><form name='formop' method='get'>"; $form .= _SELECT . " <select name='module'>"; foreach ($mods as $mod => $file) { $form .= "<option value='{$mod}'>{$mod}</option>";
function import_spiders_edit($id) { include XOOPS_ROOT_PATH . '/class/xoopslists.php'; $xl = new XoopsLists(); $files = $xl->getFileListAsArray(XOOPS_ROOT_PATH . '/modules/' . _MI_SPIDERS_DIRNAME . '/admin/resources/'); $spiders_handler =& xoops_getmodulehandler('spiders', 'spiders'); include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; if ($id != 0) { $spider = $spiders_handler->get($id, true); } else { $spider = $spiders_handler->create(); } if ($id != 0) { $form = new XoopsThemeForm(sprintf(_AM_SPIDERS_EDITSPIDER, $spider->getVar('robot-name')), "import", "", "post"); } else { $form = new XoopsThemeForm(_AM_SPIDERS_NEWSSPIDER, "import", "", "post"); } $formobjects['robot-id'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_ROBOTID, 'robot-id[' . $id . ']', 50, 128, $spider->getVar('robot-id')); $formobjects['robot-id']->setDescription(_AM_SPIDERS_TXTBOX_ROBOTID_DESC); if ($id != 0) { $formobjects['robot-id']->setExtra('disabled="disabled"'); } $formobjects['robot-name'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_ROBOTNAME, 'robot-name[' . $id . ']', 50, 255, $spider->getVar('robot-name')); $formobjects['robot-name']->setDescription(_AM_SPIDERS_TXTBOX_ROBOTNAME_DESC); $formobjects['robot-cover-url'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_COVERURL, 'robot-cover-url[' . $id . ']', 50, 255, $spider->getVar('robot-cover-url')); $formobjects['robot-cover-url']->setDescription(_AM_SPIDERS_TXTBOX_COVERURL_DESC); $formobjects['robot-details-url'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_DETAILURL, 'robot-details-url[' . $id . ']', 50, 255, $spider->getVar('robot-details-url')); $formobjects['robot-details-url']->setDescription(_AM_SPIDERS_TXTBOX_DETAILURL_DESC); $formobjects['robot-owner-name'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_OWNERNME, 'robot-owner-name[' . $id . ']', 50, 128, $spider->getVar('robot-owner-name')); $formobjects['robot-owner-name']->setDescription(_AM_SPIDERS_TXTBOX_OWNERNAME_DESC); $formobjects['robot-owner-url'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_OWNERURL, 'robot-owner-url[' . $id . ']', 50, 255, $spider->getVar('robot-owner-url')); $formobjects['robot-owner-url']->setDescription(_AM_SPIDERS_TXTBOX_OWNERURL_DESC); $formobjects['robot-owner-email'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_OWNEREMAIL, 'robot-owner-email[' . $id . ']', 50, 255, $spider->getVar('robot-owner-email')); $formobjects['robot-owner-email']->setDescription(_AM_SPIDERS_TXTBOX_OWNEREMAIL_DESC); $formobjects['robot-status'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_STATUS, 'robot-status[' . $id . ']', 50, 255, $spider->getVar('robot-status')); $formobjects['robot-status']->setDescription(_AM_SPIDERS_TXTBOX_STATUS_DESC); $formobjects['robot-purpose'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_PURPOSE, 'robot-purpose[' . $id . ']', 50, 128, $spider->getVar('robot-purpose')); $formobjects['robot-purpose']->setDescription(_AM_SPIDERS_TXTBOX_PURPOSE_DESC); $formobjects['robot-type'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_TYPE, 'robot-type[' . $id . ']', 40, 64, $spider->getVar('robot-type')); $formobjects['robot-type']->setDescription(_AM_SPIDERS_TXTBOX_TYPE_DESC); $formobjects['robot-availability'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_AVAILABILITY, 'robot-availability[' . $id . ']', 50, 128, $spider->getVar('robot-availability')); $formobjects['robot-availability']->setDescription(_AM_SPIDERS_TXTBOX_AVAILABILITY_DESC); $formobjects['robot-exclusion'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_EXCLUSION, 'robot-exclusion[' . $id . ']', 40, 64, $spider->getVar('robot-exclusion')); $formobjects['robot-exclusion']->setDescription(_AM_SPIDERS_TXTBOX_EXCLUSION_DESC); $formobjects['robot-exclusion-useragent'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_EXCLUSIONUSERAGENT, 'robot-exclusion-useragent[' . $id . ']', 50, 255, $spider->getVar('robot-exclusion-useragent')); $formobjects['robot-exclusion-useragent']->setDescription(_AM_SPIDERS_TXTBOX_EXCLUSIONUSERAGENT_DESC); $formobjects['robot-noindex'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_NOINDEX, 'robot-noindex[' . $id . ']', 20, 32, $spider->getVar('robot-noindex')); $formobjects['robot-noindex']->setDescription(_AM_SPIDERS_TXTBOX_NOINDEX_DESC); $formobjects['robot-host'] = new XoopsFormTextArea(_AM_SPIDERS_TXTBOX_HOST, 'robot-host[' . $id . ']', 40, 10, $spider->getVar('robot-host')); $formobjects['robot-host']->setDescription(_AM_SPIDERS_TXTBOX_HOST_DESC); $formobjects['robot-from'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_FROM, 'robot-from[' . $id . ']', 20, 32, $spider->getVar('robot-from')); $formobjects['robot-from']->setDescription(_AM_SPIDERS_TXTBOX_FROM_DESC); $formobjects['robot-useragent'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_USERAGENT, 'robot-useragent[' . $id . ']', 50, 255, $spider->getVar('robot-useragent')); $formobjects['robot-useragent']->setDescription(_AM_SPIDERS_TXTBOX_USERAGENT_DESC); $formobjects['robot-language'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_LANGUAGE, 'robot-language[' . $id . ']', 50, 255, $spider->getVar('robot-language')); $formobjects['robot-language']->setDescription(_AM_SPIDERS_TXTBOX_LANGUAGE_DESC); $formobjects['robot-description'] = new XoopsFormTextArea(_AM_SPIDERS_TXTBOX_DESCRIPTION, 'robot-description[' . $id . ']', 40, 10, $spider->getVar('robot-description')); $formobjects['robot-description']->setDescription(_AM_SPIDERS_TXTBOX_DESCRIPTION_DESC); $formobjects['robot-history'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_HISTORY, 'robot-history[' . $id . ']', 50, 255, $spider->getVar('robot-history')); $formobjects['robot-history']->setDescription(_AM_SPIDERS_TXTBOX_HISTORY_DESC); $formobjects['robot-environment'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_ENVIRONMENT, 'robot-environment[' . $id . ']', 50, 128, $spider->getVar('robot-environment')); $formobjects['robot-environment']->setDescription(_AM_SPIDERS_TXTBOX_ENVIRONMENT_DESC); $formobjects['modified-date'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_MODIFIEDDATE, 'modified-date[' . $id . ']', 40, 64, $spider->getVar('modified-date')); $formobjects['modified-date']->setDescription(_AM_SPIDERS_TXTBOX_MODIFIEDDATE_DESC); $formobjects['modified-by'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_MODIFIEDBY, 'modified-by[' . $id . ']', 40, 64, $spider->getVar('modified-by')); $formobjects['modified-by']->setDescription(_AM_SPIDERS_TXTBOX_MODIFIEDBY_DESC); $formobjects['robot-safeuseragent'] = new XoopsFormText(_AM_SPIDERS_TXTBOX_SAFEUSERAGENT, 'robot-safeuseragent[' . $id . ']', 50, 255, $spider->getVar('robot-safeuseragent')); $formobjects['robot-safeuseragent']->setDescription(_AM_SPIDERS_TXTBOX_SAFEUSERAGENT_DESC); $formobjects['id'] = new XoopsFormHidden('id', $id); $required = array('robot-safeuseragent', 'robot-useragent', 'robot-exclusion-useragent', 'robot-name', 'robot-id', 'robot-owner-email'); foreach ($formobjects as $id => $formobject) { if (!in_array($id, $required)) { $form->addElement($formobjects[$id], false); } else { $form->addElement($formobjects[$id], true); } } $form->addElement($fileelement); $form->addElement(new XoopsFormHidden("op", 'save')); $form->addElement(new XoopsFormButton('', 'save_list', _SUBMIT, "submit")); $form->display(); }
function _getList($name, $extension = "") { $items = array(); /* if(@ include_once XOOPS_ROOT_PATH."/Frameworks/art/functions.ini.php") { load_functions("cache"); if($items = mod_loadCacheFile("captcha_{$name}", "captcha")) { return $items; } } */ require_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; $file_path = $this->config["rootpath"] . "/{$name}"; $files = XoopsLists::getFileListAsArray($file_path); foreach ($files as $item) { if (empty($extension) || preg_match("/(\\.{$extension})\$/i", $item)) { $items[] = $item; } } if (function_exists("mod_createCacheFile")) { mod_createCacheFile($items, "captcha_{$name}", "captcha"); } return $items; }
} else { echo '<td>' . $last_imported_f; } } else { echo '<td>' . $last_imported_f; } echo '</td><td>[<a href="admin.php?fct=tplsets&op=edittpl&id=' . $btemplates[$j]->getVar('tpl_id') . '">' . _EDIT . '</a>] [<a href="admin.php?fct=tplsets&op=deletetpl&id=' . $btemplates[$j]->getVar('tpl_id') . '">' . _DELETE . '</a>] [<a href="admin.php?fct=tplsets&op=downloadtpl&id=' . $btemplates[$j]->getVar('tpl_id') . '">' . _MD_DOWNLOAD . '</a>]</td><td align="right"><input type="file" name="' . $filename . '" id="' . $filename . '" /><input type="hidden" name="xoops_upload_file[]" id="xoops_upload_file[]" value="' . $filename . '" /><input type="hidden" name="old_template[' . $filename . ']" value="' . $btemplates[$j]->getVar('tpl_id') . '" /></td>'; } else { echo '<td>[<a href="admin.php?fct=tplsets&op=edittpl&id=' . $btemplates[$j]->getVar('tpl_id') . '">' . _MD_VIEW . '</a>] [<a href="admin.php?fct=tplsets&op=downloadtpl&id=' . $btemplates[$j]->getVar('tpl_id') . '">' . _MD_DOWNLOAD . '</a>]</td>'; } echo '</tr>' . "\n"; $binst_files[] = $filename; } if ($tplset != 'default') { include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; $bnotinst_files = array_diff(XoopsLists::getFileListAsArray(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/templates/blocks/'), $binst_files); foreach ($bnotinst_files as $nfile) { if ($nfile != 'index.html') { echo '<tr style="background-color:#FFFF99;"><td style="background-color:#FFFF99; padding: 5px;">' . $nfile . '</td><td style="background-color:#FFFF99; padding: 5px;"> </td><td style="background-color:#FFFF99; padding: 5px;">'; $physical_file = XOOPS_ROOT_PATH . '/templates/' . $tplset . '/' . $moddir . '/blocks/' . $nfile; if (file_exists($physical_file)) { echo '[<a href="admin.php?fct=tplsets&moddir=' . $moddir . '&tplset=' . $tplset . '&op=importtpl&file=' . urlencode($nfile) . '">' . _MD_IMPORT . '</a>]'; } else { echo ' '; } echo '</td><td style="background-color:#FFFF99; padding: 5px;">[<a href="admin.php?fct=tplsets&moddir=' . $moddir . '&tplset=' . $tplset . '&op=generatetpl&type=block&file=' . urlencode($nfile) . '">' . _MD_GENERATE . '</a>]</td><td style="background-color:#FFFF99; padding: 5px; text-align: right"><input type="file" name="' . $nfile . '" id="' . $nfile . '" /><input type="hidden" name="xoops_upload_file[]" id="xoops_upload_file[]" value="' . $nfile . '" /></td></tr>' . "\n"; } } } echo '</table>'; if ($tplset != 'default') {
function getList($name, $extension = "") { $items = array(); xoops_load('XoopsCache'); if ($items = XoopsCache::read("captcha_captcha_{$name}")) { return $items; } require_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; $file_path = $this->config["rootpath"] . "/{$name}"; $files = XoopsLists::getFileListAsArray($file_path); foreach ($files as $item) { if (empty($extension) || preg_match("/(\\.{$extension})\$/i", $item)) { $items[] = $item; } } XoopsCache::write("captcha_captcha_{$name}", $items); return $items; }