/** * Constructor * * @return void */ public function __construct() { $preloadFilesArray = str_replace('.php', '', icms_core_Filesystem::getFileList(ICMS_PRELOAD_PATH, '', array('php'))); foreach ($preloadFilesArray as $filename) { // exclude index.html if (!in_array($this->getClassName($filename), get_declared_classes())) { $this->_preloadFilesArray[] = $filename; $this->addPreloadEvents($filename); } } // add ondemand preload global $icmsOnDemandPreload; if (isset($icmsOnDemandPreload) && count($icmsOnDemandPreload) > 0) { foreach ($icmsOnDemandPreload as $onDemandPreload) { $this->_preloadFilesArray[] = $onDemandPreload['filename']; $this->addPreloadEvents($onDemandPreload['filename'], $onDemandPreload['module']); } } }
/** * Get an array of plugins * @param string $path * @return multitype: */ public function getPluginsArray($path) { $module_handler = icms::handler('icms_module'); $criteria = new icms_db_criteria_Compo(); $criteria->add(new icms_db_criteria_Item('isactive', 1)); $tempModulesObj = $module_handler->getObjects($criteria); $modulesObj = array(); foreach ($tempModulesObj as $moduleObj) { $modulesObj[$moduleObj->getVar('dirname')] = $moduleObj; } $aFiles = str_replace('.php', '', icms_core_Filesystem::getFileList(ICMS_ROOT_PATH . '/plugins/' . $path . '/', '', array('php'))); $ret = array(); foreach ($aFiles as $pluginName) { $module_xoops_version_file = ICMS_ROOT_PATH . "/modules/{$pluginName}/xoops_version.php"; $module_icms_version_file = ICMS_ROOT_PATH . "/modules/{$pluginName}/icms_version.php"; if ((file_exists($module_xoops_version_file) || file_exists($module_icms_version_file)) && isset($modulesObj[$pluginName])) { $ret[$pluginName] = $modulesObj[$pluginName]->getVar('name'); } } return $ret; }
/** * Gets list of all avatar image files inside default avatars directory * * @return mixed $avatars|false list of avatar files in the directory or false if no avatars */ public static function getAllFromDir() { $avatars = array(); $dirlist = array(); $dirlist = icms_core_Filesystem::getDirList(ICMS_ROOT_PATH . "/images/avatar/"); if (count($dirlist) > 0) { foreach ($dirlist as $dir) { $avatars[$dir] =& icms_core_Filesystem::getFileList(ICMS_ROOT_PATH . "/images/avatar/" . $dir . "/", $dir . "/", array('gif', 'jpg', 'png')); } } else { return false; } return $avatars; }
/** * Gets list of subject icon image file names in a certain directory * @deprecated Use icms_core_Filesystem::getFileList(ICMS_ROOT_PATH . "/images/subject/", '', array('gif', 'jpg', 'png')); * @todo Remove in 1.4 * * If directory is not specified, default directory will be searched. * * @param string $sub_dir name of the directory to scan for files * @return array $subjects list of subject files in the directory */ public static function getSubjectsList($sub_dir = "") { icms_core_Debug::setDeprecated('icms_core_Filesystem::getFileList(ICMS_ROOT_PATH . "/images/subject/" , array("gif", "jpg", "png"))', sprintf(_CORE_REMOVE_IN_VERSION, '1.4')); $subjects = array(); if ($sub_dir != "") { $subjects = icms_core_Filesystem::getFileList(ICMS_ROOT_PATH . "/images/subject/" . $sub_dir, $sub_dir . "/", array('gif', 'jpg', 'png')); } else { $subjects = icms_core_Filesystem::getFileList(ICMS_ROOT_PATH . "/images/subject/", '', array('gif', 'jpg', 'png')); } return $subjects; }
* @license LICENSE.txt * @package Administration * @subpackage Comments * @since XOOPS * @author http://www.xoops.org The XOOPS Project * @author modified by UnderDog <*****@*****.**> * @version SVN: $Id: commentform.inc.php 20768 2011-02-06 00:02:25Z skenow $ */ defined("ICMS_ROOT_PATH") || die("ImpressCMS root path not defined"); $cform = new icms_form_Theme(_CM_POSTCOMMENT, "commentform", "postcomment.php", "post", true); if (!preg_match("/^re:/i", $subject)) { $subject = "Re: " . icms_core_DataFilter::icms_substr($subject, 0, 56); } $cform->addElement(new icms_form_elements_Text(_CM_TITLE, 'subject', 50, 255, $subject), true); $icons_radio = new icms_form_elements_Radio(_MESSAGEICON, 'icon', $icon); $subject_icons = icms_core_Filesystem::getFileList(ICMS_ROOT_PATH . "/images/subject/", '', array('gif', 'jpg', 'png')); foreach ($subject_icons as $iconfile) { $icons_radio->addOption($iconfile, '<img src="' . ICMS_IMAGES_URL . '/subject/' . $iconfile . '" alt="" />'); } $cform->addElement($icons_radio); $cform->addElement(new icms_form_elements_Dhtmltextarea(_CM_MESSAGE, 'message', $message, 10, 50), true); $option_tray = new icms_form_elements_Tray(_OPTIONS, '<br />'); if (icms::$user) { if ($icmsConfig['anonpost'] == true) { $noname_checkbox = new icms_form_elements_Checkbox('', 'noname', $noname); $noname_checkbox->addOption(1, _POSTANON); $option_tray->addElement($noname_checkbox); } if (icms::$user->isAdmin($icmsModule->getVar('mid'))) { $nohtml_checkbox = new icms_form_elements_Checkbox('', 'nohtml', $nohtml); $nohtml_checkbox->addOption(1, _DISABLEHTML);
echo '</td><td style="vertical-align: middle;">' . '<a href="admin.php?fct=tplsets&op=edittpl&id=' . $btemplates[$j]->getVar('tpl_id') . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/edit.png" alt="' . _EDIT . '" title="' . _EDIT . '" /></a>' . ' <a href="admin.php?fct=tplsets&op=downloadtpl&id=' . $btemplates[$j]->getVar('tpl_id') . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/filesave2.png" alt="' . _MD_DOWNLOAD . '" title="' . _MD_DOWNLOAD . '" /></a>' . ' <a href="admin.php?fct=tplsets&op=deletetpl&id=' . $btemplates[$j]->getVar('tpl_id') . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/editdelete.png" alt="' . _DELETE . '" title="' . _DELETE . '" /></a>' . '</td><td style="vertical-align: middle;" align="' . _GLOBAL_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') . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/viewmag.png" alt="' . _MD_VIEW . '" title="' . _MD_VIEW . '" /></a> <a href="admin.php?fct=tplsets&op=downloadtpl&id=' . $btemplates[$j]->getVar('tpl_id') . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/filesave2.png" alt="' . _MD_DOWNLOAD . '" title="' . _MD_DOWNLOAD . '" /></a></td>'; } echo '</tr>' . "\n"; $binst_files[] = $filename; } if ($tplset != 'default') { $bnotinst_files = array_diff(icms_core_Filesystem::getFileList(ICMS_MODULES_PATH . '/' . $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;">' . $nfile . '</td><td style="background-color:#FFFF99;"> </td><td style="background-color:#FFFF99;">'; $physical_file = ICMS_THEME_PATH . '/' . $tplset . '/templates/' . $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;"><a href="admin.php?fct=tplsets&moddir=' . $moddir . '&tplset=' . $tplset . '&op=generatetpl&type=block&file=' . urlencode($nfile) . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/filenew2.png" alt="' . _MD_GENERATE . '" title="' . _MD_GENERATE . '" /></a></td> <td style="background-color:#FFFF99; vertical-align: middle; text-align: ' . _GLOBAL_RIGHT . '">' . '<input type="file" name="' . $nfile . '" id="' . $nfile . '" />' . '<input type="hidden" name="xoops_upload_file[]" id="xoops_upload_file[]" value="' . $nfile . '" />'
case 'select_paginati' : if (file_exists(ICMS_LIBRARIES_PATH . '/paginationstyles/paginationstyles.php')) { include ICMS_LIBRARIES_PATH . '/paginationstyles/paginationstyles.php'; $st = & $styles; $arr = array(); foreach ($st as $style) { $arr[$style['fcss']] = $style['name']; } $ele = new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); $ele->addOptionArray($arr); } break; case 'select_geshi' : $ele = new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); $dirlist = str_replace('.php', '', icms_core_Filesystem::getFileList(ICMS_LIBRARIES_PATH . '/geshi/geshi/', '', array('php'))); if (! empty($dirlist)) { asort($dirlist); $ele->addOptionArray($dirlist); } break; case 'textbox' : default : $ele = new icms_form_elements_Text($title, $config[$i]->getVar('conf_name'), 50, 255, icms_core_DataFilter::htmlSpecialChars($config[$i]->getConfValueForOutput())); break; } $hidden = new icms_form_elements_Hidden('conf_ids[]', $config[$i]->getVar('conf_id')); $form->addElement($ele); $form->addElement($hidden); unset($ele, $hidden);
/** * Gets list of Captcha items (Internal Function) * @param string $name directory name to look in * @param string $extension extension of the files to look for * @return array array of Captcha items */ public function _getList($name, $extension = "") { $items = array(); $file_path = "{$name}"; $files = icms_core_Filesystem::getFileList($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; }
private function getCustomFilterList() { $dirPath = ICMS_LIBRARIES_PATH . '/htmlpurifier/standalone/HTMLPurifier/Filter/'; $icmsConfigPurifier = icms::$config->getConfigsByCat(ICMS_CONF_PURIFIER); if ($icmsConfigPurifier['purifier_Filter_AllowCustom'] !== 0) { $filterList = array(); $fileList = icms_core_Filesystem::getFileList($dirPath, '', array('php'), true); unset($fileList['ExtractStyleBlocks.php'], $fileList['YouTube.php']); $fileList = array_values($fileList); foreach ($fileList as &$val) { $val = "HTMLPurifier_Filter_" . substr($val, 0, strrpos($val, '.')); $newObject = new $val(); $filterList[] = $newObject; } } else { $filterList = ''; } return $filterList; }
<?php /** * Pagination Styles Library Configuration File * * This file is responsible for configuration of the Pagination Styles library * * @copyright The ImpressCMS Project http://www.impresscms.org/ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL) * @package libraries * @since 1.2 * @author TheRplima <*****@*****.**> * @version $Id: paginationstyles.php 1742 2008-04-20 14:46:20Z real_therplima $ */ $style_list = icms_core_Filesystem::getFileList(ICMS_LIBRARIES_PATH . "/paginationstyles/css/", "", array("css"), TRUE); foreach ($style_list as $filename) { $filename = str_ireplace(".css", "", $filename); $styles[] = array('name' => ucfirst($filename), 'fcss' => $filename); }