/** * Gets list of available editors * * @param bool $noHtml is this an editor with no html options? * @return array $_list list of available editors that are allowed (through admin config) */ public function &getList($noHtml = FALSE) { $list = @(include_once ICMS_CACHE_PATH . $this->_type . 'editor_list.php'); if (empty($list)) { $list = array(); $order = array(); $_list = icms_core_Filesystem::getDirList($this->root_path . '/'); foreach ($_list as $item) { if (@(include $this->root_path . '/' . $item . '/editor_registry.php')) { if (empty($config['order'])) { continue; } $order[] = $config['order']; $list[$item] = array("title" => $config["title"], "nohtml" => @$config["nohtml"]); } } array_multisort($order, $list); $contents = "<?php\n return " . var_export($list, TRUE) . "\n?>"; icms_core_Filesystem::writeFile($contents, $this->_type . 'editor_list', 'php', ICMS_CACHE_PATH); } $editors = array_keys($list); if (!empty($this->allowed_editors)) { $editors = array_intersect($editors, $this->allowed_editors); } $_list = array(); foreach ($editors as $name) { if (!empty($noHtml) && empty($list[$name]['nohtml'])) { continue; } $_list[$name] = $list[$name]['title']; } return $_list; }
/** * Constructor * * @return void */ public function __construct() { $librariesArray = icms_core_Filesystem::getDirList(ICMS_LIBRARIES_PATH); foreach ($librariesArray as $library) { $library_boot_file = $this->getLibraryBootFilePath($library); if (file_exists($library_boot_file)) { include_once $library_boot_file; $this->_librariesArray[] = $library; } } }
/** * Initializes the multilanguage process * */ static public function initMultilang() { global $icmsConfigMultilang, $icmsConfig; if ($icmsConfigMultilang['ml_enable']) { require_once ICMS_INCLUDE_PATH . '/im_multilanguage.php' ; $easiestml_langs = explode(',', $icmsConfigMultilang['ml_tags']); $easiestml_langpaths = icms_core_Filesystem::getDirList(ICMS_ROOT_PATH . "/language/"); $langs = array_combine($easiestml_langs, explode(',', $icmsConfigMultilang['ml_names'])); if ($icmsConfigMultilang['ml_autoselect_enabled'] && isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && $_SERVER['HTTP_ACCEPT_LANGUAGE'] != "" ) { $autolang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2); if (in_array($autolang, $easiestml_langs)) { $icmsConfig['language'] = $langs[$autolang]; } } if (isset($_GET['lang']) && isset($_COOKIE['lang'])) { if (in_array($_GET['lang'], $easiestml_langs)) { $icmsConfig['language'] = $langs[$_GET['lang']]; if (isset($_SESSION['UserLanguage'])) { $_SESSION['UserLanguage'] = $langs[$_GET['lang']]; } } } elseif (isset($_COOKIE['lang']) && isset($_SESSION['UserLanguage'])) { if ($_COOKIE['lang'] != $_SESSION['UserLanguage']) { if (in_array($_SESSION['UserLanguage'], $langs)) { $icmsConfig['language'] = $_SESSION['UserLanguage']; } } else { if (in_array($_COOKIE['lang'], $easiestml_langs)) { $icmsConfig['language'] = $langs[$_COOKIE['lang']]; } } } elseif (isset($_COOKIE['lang'])) { if (in_array($_COOKIE['lang'], $easiestml_langs)) { $icmsConfig['language'] = $langs[$_COOKIE['lang']]; if (isset( $_SESSION['UserLanguage'] )) { $_SESSION['UserLanguage'] = $langs[$_GET['lang']]; } } } elseif (isset($_GET['lang'])) { if (in_array($_GET['lang'], $easiestml_langs)) { $icmsConfig['language'] = $langs[$_GET['lang']]; } } } }
/** * 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; }
/** * Constructor * * @param string $caption * @param string $name * @param mixed $value Pre-selected value (or array of them). * Legal is any name of a ICMS_ROOT_PATH."/language/" subdirectory. * @param int $size Number of rows. "1" makes a drop-down-list. */ public function __construct($caption, $name, $value = null, $size = 1) { parent::__construct($caption, $name, $value, $size); $this->addOptionArray(icms_core_Filesystem::getDirList(ICMS_ROOT_PATH . "/language/")); }
/** * Gets list of language folders inside default language directory - can't find anywhere in the core * @deprecated Use icms_core_Filesystem::getDirList, instead * @todo Remove in 1.4 * @return array $lang_list list of language files in the directory */ public static function getLangList() { icms_core_Debug::setDeprecated('icms_core_Filesystem::getDirList{ICMS_ROOT_PATH . "/language/")', sprintf(_CORE_REMOVE_IN_VERSION, '1.4')); return icms_core_Filesystem::getDirList(ICMS_ROOT_PATH . "/language/"); }
function getDBList() { $dirname = '../class/database/drivers'; $list = icms_core_Filesystem::getDirList($dirname); // TODO: Add any verification of compatibility between the database drivers and the system. return $list; }
$ele->addOptionArray($dirlist); } break; case 'select_font' : $ele = new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); $dirlist = icms_core_Filesystem::getFileList(ICMS_LIBRARIES_PATH . '/icms/form/elements/captcha/fonts/', '', array('ttf')); if (! empty($dirlist)) { asort($dirlist); $ele->addOptionArray($dirlist); } break; case 'select_plugin' : $ele = new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput(), 8, TRUE); $dirlist = icms_core_Filesystem::getDirList(ICMS_PLUGINS_PATH . '/textsanitizer/'); if (! empty($dirlist)) { asort($dirlist); $ele->addOptionArray($dirlist); } break; case 'tplset' : $ele = new icms_form_elements_Select($title, $config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput()); $tplset_handler = icms::handler('icms_view_template_set'); $tplsetlist = $tplset_handler->getList(); asort($tplsetlist); foreach ($tplsetlist as $key => $name) { $ele->addOption($key, $name); } // old theme value is used to determine whether to update cache or not. kind of dirty way
$groups = icms::$user->getGroups(); } else { $groups = array(); } $all_ok = FALSE; if (!in_array(ICMS_GROUP_ADMIN, $groups)) { $sysperm_handler = icms::handler('icms_member_groupperm'); $ok_syscats =& $sysperm_handler->getItemIds('system_admin', $groups); } else { $all_ok = TRUE; } require_once ICMS_ROOT_PATH . '/modules/system/constants.php'; $admin_dir = ICMS_ROOT_PATH . '/modules/system/admin'; $dirlist = icms_core_Filesystem::getDirList($admin_dir); icms_loadLanguageFile('system', 'admin'); asort($dirlist); $adminmenu = array(); foreach ($dirlist as $file) { $mod_version_file = 'xoops_version.php'; if (file_exists($admin_dir . '/' . $file . '/icms_version.php')) { $mod_version_file = 'icms_version.php'; } include $admin_dir . '/' . $file . '/' . $mod_version_file; if ($modversion['hasAdmin']) { $category = isset($modversion['category']) ? (int) ($modversion['category']) : 0; if (FALSE != $all_ok || in_array($modversion['category'], $ok_syscats)) { $adminmenu[$modversion['group']]['title'] = $modversion['group']; $adminmenu[$modversion['group']]['link'] = "#";
if ($_SERVER['REQUEST_METHOD'] == 'POST') { $lang = $_REQUEST['lang']; $languages = icms_core_Filesystem::getDirList("./language/"); if (!in_array($lang, $languages)) { $lang = 'english'; } setcookie('xo_install_lang', $lang, null, null, null); $wizard->redirectToPage('+1'); exit; } $_SESSION = array(); $pageHasForm = true; $pageHasHelp = true; $title = LANGUAGE_SELECTION; $content = ""; $languages = icms_core_Filesystem::getDirList("./language/"); foreach ($languages as $lang) { $sel = $lang == $wizard->language ? ' checked="checked"' : ''; $content .= "<div class=\"langselect\" style=\"text-decoration: none;\"><a href=\"javascript:void(0);\" style=\"text-decoration: none;\"><img src=\"../images/flags/{$lang}.gif\" alt=\"{$lang}\" /><br />{$lang}<br /> <input type=\"radio\" name=\"lang\" value=\"{$lang}\"{$sel} /></a></div>"; } $content .= '<fieldset style="text-align: center;">'; $content .= '<legend>Select an Alternative Language Pack to Download</legend>'; $content .= '<div class="xoform-help">Languages may or may not be available if this is a development release.</div>'; $content .= '<div class="langselect" style="text-decoration: none;"><a href="http://addons.impresscms.org/modules/wfdownloads/viewcat.php?cid=241" target="_blank" style="text-decoration: none;"><img src="../images/flags/portuguesebr.gif" alt="Portuguese/BR Language Pack" /><br />Portug.<br /><BRAZIL><br /></a></div>'; $content .= '<div class="langselect" style="text-decoration: none;"><a href="http://addons.impresscms.org/modules/wfdownloads/viewcat.php?cid=243" target="_blank" style="text-decoration: none;"><img src="../images/flags/nederlands.gif" alt="Dutch Language Pack" /><br />Dutch<br /></a></div>'; $content .= '<div class="langselect" style="text-decoration: none;"><a href="http://addons.impresscms.org/modules/wfdownloads/viewcat.php?cid=236" target="_blank" style="text-decoration: none;"><img src="../images/flags/french.gif" alt="French Language Pack" /><br />French<br /></a></div>'; $content .= '<div class="langselect" style="text-decoration: none;"><a href="http://addons.impresscms.org/modules/wfdownloads/viewcat.php?cid=239" target="_blank" style="text-decoration: none;"><img src="../images/flags/german.gif" alt="German Language Pack" /><br />German<br /></a></div>'; $content .= '<div class="langselect" style="text-decoration: none;"><a href="http://addons.impresscms.org/modules/wfdownloads/viewcat.php?cid=247" target="_blank" style="text-decoration: none;"><img src="../images/flags/italian.gif" alt="Italian Language Pack" /><br />Italian<br /></a></div>'; $content .= '<div class="langselect" style="text-decoration: none;"><a href="http://addons.impresscms.org/modules/wfdownloads/viewcat.php?cid=237" target="_blank" style="text-decoration: none;"><img src="../images/flags/persian.gif" alt="Persian Language Pack" /><br />Persian<br /></a></div>'; $content .= '<div class="langselect" style="text-decoration: none;"><a href="http://addons.impresscms.org/modules/wfdownloads/viewcat.php?cid=240" target="_blank" style="text-decoration: none;"><img src="../images/flags/spanish.gif" alt="Spanish Language Pack" /><br />Spanish<br /></a></div>'; $content .= '<div style="text-align: center; margin-top: 5px;"><a href="http://addons.impresscms.org/modules/wfdownloads/viewcat.php?cid=11" target="_blank">Select another language not listed here.</a></div>';
$sig_cbox_value = icms::$user->getVar('attachsig') ? 1 : 0; $sig_cbox = new icms_form_elements_Checkbox('', 'attachsig', $sig_cbox_value); $sig_cbox->addOption(1, _US_SHOWSIG); $sig_tray->addElement($sig_cbox); } } $umode_select = new icms_form_elements_Select(_US_CDISPLAYMODE, 'umode', icms::$user->getVar('umode')); $umode_select->addOptionArray(array('nest' => _NESTED, 'flat' => _FLAT, 'thread' => _THREADED)); $uorder_select = new icms_form_elements_Select(_US_CSORTORDER, 'uorder', icms::$user->getVar('uorder')); $uorder_select->addOptionArray(array(XOOPS_COMMENT_OLD1ST => _OLDESTFIRST, XOOPS_COMMENT_NEW1ST => _NEWESTFIRST)); $selected_theme = new icms_form_elements_Select(_US_SELECT_THEME, 'theme_selected', icms::$user->getVar('theme')); foreach ($icmsConfig['theme_set_allowed'] as $theme) { $selected_theme->addOption($theme, $theme); } $selected_language = new icms_form_elements_Select(_US_SELECT_LANG, 'language_selected', icms::$user->getVar('language')); foreach (icms_core_Filesystem::getDirList(ICMS_ROOT_PATH . "/language/") as $language) { $selected_language->addOption($language, $language); } // TODO: add this to admin user-edit functions... icms_loadLanguageFile('core', 'notification'); include_once ICMS_INCLUDE_PATH . '/notification_constants.php'; $notify_method_select = new icms_form_elements_Select(_NOT_NOTIFYMETHOD, 'notify_method', icms::$user->getVar('notify_method')); $notify_method_select->addOptionArray(array(XOOPS_NOTIFICATION_METHOD_DISABLE => _NOT_METHOD_DISABLE, XOOPS_NOTIFICATION_METHOD_PM => _NOT_METHOD_PM, XOOPS_NOTIFICATION_METHOD_EMAIL => _NOT_METHOD_EMAIL)); $notify_mode_select = new icms_form_elements_Select(_NOT_NOTIFYMODE, 'notify_mode', icms::$user->getVar('notify_mode')); $notify_mode_select->addOptionArray(array(XOOPS_NOTIFICATION_MODE_SENDALWAYS => _NOT_MODE_SENDALWAYS, XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE => _NOT_MODE_SENDONCE, XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT => _NOT_MODE_SENDONCEPERLOGIN)); $bio_tarea = new icms_form_elements_Textarea(_US_EXTRAINFO, 'bio', icms::$user->getVar('bio', 'E')); $cookie_radio_value = empty($_COOKIE[$icmsConfig['usercookie']]) ? 0 : 1; $cookie_radio = new icms_form_elements_Radioyn(_US_USECOOKIE, 'usecookie', $cookie_radio_value, _YES, _NO); $pwd_text = new icms_form_elements_Password('', 'password', 10, 255, "", FALSE, $icmsConfigUser['pass_level'] ? 'password_adv' : ''); $pwd_text2 = new icms_form_elements_Password('', 'vpass', 10, 255); $pwd_tray = new icms_form_elements_Tray(_US_PASSWORD . '<br />' . _US_TYPEPASSTWICE);
/** * New Admin Control Panel Block, with grouping of items * * @since ImpressCMS 1.3 * @return array */ function b_system_admin_cp_new_show() { global $icmsTpl, $icmsConfig; $block['lang_cp'] = _CPHOME; // Loading System Configuration Links if (is_object(icms::$user)) { $groups = icms::$user->getGroups(); } else { $groups = array(); } $all_ok = FALSE; if (!in_array(ICMS_GROUP_ADMIN, $groups)) { $sysperm_handler = icms::handler('icms_member_groupperm'); $ok_syscats =& $sysperm_handler->getItemIds('system_admin', $groups); } else { $all_ok = TRUE; } require_once ICMS_MODULES_PATH . '/system/constants.php'; $admin_dir = ICMS_MODULES_PATH . '/system/admin'; $dirlist = icms_core_Filesystem::getDirList($admin_dir); icms_loadLanguageFile('system', 'admin'); asort($dirlist); $block = array(); foreach ($dirlist as $file) { $mod_version_file = 'xoops_version.php'; if (file_exists($admin_dir . '/' . $file . '/icms_version.php')) { $mod_version_file = 'icms_version.php'; } include $admin_dir . '/' . $file . '/' . $mod_version_file; if ($modversion['hasAdmin']) { $category = isset($modversion['category']) ? (int) $modversion['category'] : 0; if (FALSE != $all_ok || in_array($modversion['category'], $ok_syscats)) { $block[$modversion['group']][] = array('title' => $modversion['name'], 'link' => ICMS_MODULES_URL . '/system/admin.php?fct=' . $file, 'image' => ICMS_MODULES_URL . '/system/admin/' . $file . '/images/' . $file . '_big.png'); } } unset($modversion); } if (count($block) > 0) { ksort($block); return $block; } }
/** * Returns an array of all available modules, based on folders in the modules directory * * The getList method cannot be used for this, because uninstalled modules are not listed * in the database * * @since 1.3 * @return array List of folder names in the modules directory */ public static function getAvailable() { $dirtyList = $cleanList = array(); $dirtyList = icms_core_Filesystem::getDirList(ICMS_MODULES_PATH . '/'); foreach ($dirtyList as $item) { if (file_exists(ICMS_MODULES_PATH . '/' . $item . '/icms_version.php')) { $cleanList[$item] = $item; } elseif (file_exists(ICMS_MODULES_PATH . '/' . $item . '/xoops_version.php')) { $cleanList[$item] = $item; } } return $cleanList; }
$orig_img = WideImage::load(ICMS_IMANAGER_FOLDER_PATH . '/temp/' . $orig_img_name); } $img = array(); $img['name'] = $temp_img_name; $img['originalname'] = $original_image->getVar('image_name'); $img['id'] = $original_image->getVar('image_id'); $img['title'] = $original_image->getVar('image_nicename'); $img['url'] = ICMS_IMANAGER_FOLDER_URL . '/temp/' . $temp_img_name; $img['previewurl'] = ICMS_IMANAGER_FOLDER_URL . '/temp/' . $temp_img_name . '?' . time(); $img['originalurl'] = ICMS_IMANAGER_FOLDER_URL . '/temp/' . $orig_img_name; $img['path'] = ICMS_IMANAGER_FOLDER_PATH . '/temp/' . $temp_img_name; $img['width'] = $temp_img->getWidth(); $img['height'] = $temp_img->getHeight(); $img['size'] = icms_convert_size(filesize(ICMS_IMANAGER_FOLDER_PATH . '/temp/' . $temp_img_name)); $img['ori_width'] = $orig_img->getWidth(); $img['ori_height'] = $orig_img->getHeight(); $img['ori_size'] = icms_convert_size(filesize(ICMS_IMANAGER_FOLDER_PATH . '/temp/' . $orig_img_name)); $icmsTpl->assign('image', $img); #Getting the plugins for the editor $plugins_arr = icms_core_Filesystem::getDirList(ICMS_LIBRARIES_PATH . '/image-editor/plugins'); foreach ($plugins_arr as $plugin_folder) { if (file_exists(ICMS_LIBRARIES_PATH . '/image-editor/plugins/' . $plugin_folder . '/icms_plugin_version.php')) { if (file_exists(ICMS_LIBRARIES_PATH . '/image-editor/plugins/' . $plugin_folder . '/language/' . $icmsConfig['language'] . '/main.php')) { include_once ICMS_LIBRARIES_PATH . '/image-editor/plugins/' . $plugin_folder . '/language/' . $icmsConfig['language'] . '/main.php'; } include_once ICMS_LIBRARIES_PATH . '/image-editor/plugins/' . $plugin_folder . '/icms_plugin_version.php'; $icmsTpl->append('plugins', $plugversion); unset($plugversion); } } echo $icmsTpl->fetch(ICMS_LIBRARIES_PATH . '/image-editor/templates/image-editor.html');
/** * Gets list of administration themes folder from themes directory, excluding any directories that do not have theme_admin.html * @return array */ public static function getAdminThemesList() { $dirtyList1 = $cleanList1 = array(); $dirtyList2 = $cleanList2 = array(); $dirtyList1 = icms_core_Filesystem::getDirList(ICMS_THEME_PATH . '/'); $dirtyList2 = icms_core_Filesystem::getDirList(ICMS_MODULES_PATH . '/system/themes/'); foreach ($dirtyList1 as $item1) { if (file_exists(ICMS_THEME_PATH . '/' . $item1 . '/theme_admin.html')) { $cleanList1[$item1] = $item1; } } foreach ($dirtyList2 as $item2) { if (file_exists(ICMS_MODULES_PATH . '/system/themes/' . $item2 . '/theme.html') || file_exists(ICMS_MODULES_PATH . '/system/themes/' . $item2 . '/theme_admin.html')) { $cleanList2[$item2] = $item2; } } $cleanList = array_merge($cleanList1, $cleanList2); return $cleanList; }