/** * Do this event when saving item * * @param array config array */ function eventAfterSaveSystemAdminPreferencesItems($array) { if (!isset($array[ICMS_CONF_AUTOTASKS])) return; $handler = icms_getModuleHandler('autotasks', 'system'); $handler->virtual_config = array(); $array = &$array[ICMS_CONF_AUTOTASKS]; $vconfig1 = array(); $vconfig2 = array(); foreach ($array as $key => $values) { $vconfig1[$key] = $values[0]; $vconfig2[$key] = $values[1]; } $handler->enableVirtualConfig($vconfig1); $system = $handler->getCurrentSystemHandler(true); if ($system->isEnabled()) { $system->stop(); } $handler->enableVirtualConfig($vconfig2); $system = $handler->getCurrentSystemHandler(true); if ($rez = $system->canRun()) { $time = (int) ($handler->getRealTasksRunningTime()); $rez = $system->start($time); } else { icms_loadLanguageFile('system', 'autotasks', true); icms_core_Message::error(_CO_ICMS_AUTOTASKS_INIT_ERROR); return false; } $handler->disableVirtualConfig(); }
function profile_db_upgrade_1() { icms_loadLanguageFile('core', 'user'); icms_loadLanguageFile('core', 'notification'); addStep(_MI_PROFILE_CAT_BASEINFO, '', 1, 0); addStep(_MI_PROFILE_CAT_EXTINFO, '', 2, 1); addCategory(_MI_PROFILE_CAT_PERSONAL, 1); addCategory(_MI_PROFILE_CAT_MESSAGING, 3); addCategory(_MI_PROFILE_CAT_SETTINGS1, 4); addCategory(_MI_PROFILE_CAT_COMMUNITY, 2); include_once ICMS_ROOT_PATH . '/include/notification_constants.php'; $umode_options = array('nest' => _NESTED, 'flat' => _FLAT, 'thread' => _THREADED); $uorder_options = array(0 => _OLDESTFIRST, 1 => _NEWESTFIRST); $notify_mode_options = array(XOOPS_NOTIFICATION_MODE_SENDALWAYS => _NOT_MODE_SENDALWAYS, XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE => _NOT_MODE_SENDONCE, XOOPS_NOTIFICATION_MODE_SENDONCETHENWAIT => _NOT_MODE_SENDONCEPERLOGIN); $notify_method_options = array(XOOPS_NOTIFICATION_METHOD_DISABLE => _NOT_METHOD_DISABLE, XOOPS_NOTIFICATION_METHOD_PM => _NOT_METHOD_PM, XOOPS_NOTIFICATION_METHOD_EMAIL => _NOT_METHOD_EMAIL); $fieldid = addField('name', _US_REALNAME, '', 1, 'textbox', 1, 1, 1, array(), 1, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_from', _US_LOCATION, '', 1, 'location', 1, 2, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_occ', _US_OCCUPATION, '', 1, 'textbox', 1, 3, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_intrest', _US_INTEREST, '', 1, 'textbox', 1, 4, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('bio', _US_EXTRAINFO, '', 1, 'textarea', 2, 5, 1, array(), 2, 0); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_aim', _US_AIM, '', 2, 'textbox', 1, 1, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_icq', _US_ICQ, '', 2, 'textbox', 1, 2, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_msnm', _US_MSNM, '', 2, 'textbox', 1, 3, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_yim', _US_YIM, '', 2, 'textbox', 1, 4, 1, array(), 2, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_viewemail', _US_ALLOWVIEWEMAIL, '', 3, 'yesno', 3, 1, 1, array(), 1, 1); $fieldid = addField('attachsig', _US_SHOWSIG, '', 3, 'yesno', 3, 2, 1, array(), 0, 1); $fieldid = addField('user_mailok', _US_MAILOK, '', 3, 'yesno', 3, 3, 1, array(), 1, 1); $fieldid = addField('theme', _US_SELECT_THEME, '', 3, 'theme', 1, 4, 1, array(), 0, 0); $fieldid = addField('language', _US_SELECT_LANG, '', 3, 'language', 1, 5, 1, array(), 0, 0); $fieldid = addField('umode', _US_CDISPLAYMODE, '', 3, 'select', 3, 6, 1, $umode_options, 0, 0); $fieldid = addField('uorder', _US_CSORTORDER, '', 3, 'select', 3, 7, 1, $uorder_options, 0, 0); $fieldid = addField('notify_mode', _NOT_NOTIFYMODE, '', 3, 'select', 3, 8, 1, $notify_mode_options, 0, 0); $fieldid = addField('notify_method', _NOT_NOTIFYMETHOD, '', 3, 'select', 3, 9, 1, $notify_method_options, 0, 0); $fieldid = addField('timezone_offset', _US_TIMEZONE, '', 3, 'timezone', 1, 10, 1, array(), 2, 0); $fieldid = addField('user_viewoid', _US_ALLOWVIEWEMAILOPENID, '', 3, 'yesno', 3, 11, 0, array(), 1, 1); $fieldid = addField('url', _US_WEBSITE, '', 4, 'url', 1, 1, 1, array(), 1, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('posts', _US_POSTS, '', 4, 'textbox', 3, 2, 0, array(), 0, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('rank', _US_RANK, '', 4, 'rank', 3, 3, 1, array(), 0, 0); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('user_regdate', _US_MEMBERSINCE, '', 4, 'datetime', 3, 4, 0, array(), 0, 10); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('last_login', _US_LASTLOGIN, '', 4, 'datetime', 3, 5, 0, array(), 0, 10); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); $fieldid = addField('openid', _US_OPENID_FORM_CAPTION, '', 4, 'textbox', 1, 6, 0, array(), 1, 255); addVisibility($fieldid, array(ICMS_GROUP_ADMIN), 0); $fieldid = addField('user_sig', _US_SIGNATURE, '', 4, 'dhtml', 1, 7, 1, array(), 0, 0); addVisibility($fieldid, array(ICMS_GROUP_ADMIN, ICMS_GROUP_USERS), 0); return true; }
/** * Get a reference to the only instance of database class and connects to DB * * if the class has not been instantiated yet, this will also take * care of that * * @static * @return object Reference to the only instance of database class */ public static function instance() { if (self::$xoopsInstance !== false) { return self::$xoopsInstance; } $allowWebChanges = defined('XOOPS_DB_PROXY') ? false : true; if (substr(XOOPS_DB_TYPE, 0, 4) == 'pdo.') { self::$xoopsInstance = new icms_db_legacy_PdoDatabase(self::$pdoInstance, $allowWebChanges); } else { if (defined('XOOPS_DB_ALTERNATIVE') && class_exists(XOOPS_DB_ALTERNATIVE)) { $class = XOOPS_DB_ALTERNATIVE; } else { $class = 'icms_db_legacy_' . XOOPS_DB_TYPE; $class .= $allowWebChanges ? '_Safe' : '_Proxy'; } self::$xoopsInstance = new $class(); self::$xoopsInstance->setLogger(icms::$logger); if (!self::$xoopsInstance->connect()) { icms_loadLanguageFile('core', 'core'); trigger_error(_CORE_DB_NOTRACEDB, E_USER_ERROR); } } self::$xoopsInstance->setPrefix(XOOPS_DB_PREFIX); return self::$xoopsInstance; }
/** * Provides a backtrace for deprecated methods and functions, will be in the error section of debug * This takes the place of icms_deprecated() * * @param string $replacement Method or function to be used instead of the deprecated method or function * @param string $extra Additional information to provide about the change */ public static function setDeprecated($replacement = '', $extra = '') { if (defined("ICMS_TRACK_DEPRECATED") and !ICMS_TRACK_DEPRECATED) { //error_log("icms_core_Debug::setDeprecated('$replacement', '$extra');"); return; // if we're not actively upgrading deprecated functions, no need to spend time tracking them } icms_loadLanguageFile('core', 'core'); $trace = debug_backtrace(); array_shift($trace); $level = $msg = $message = ''; $pre = '<strong><em>(' . _CORE_DEPRECATED . ')</em></strong> - '; if ($trace[0]['function'] != 'include' && $trace[0]['function'] != 'include_once' && $trace[0]['function'] != 'require' && $trace[0]['function'] != 'require_once') { $pre .= $trace[0]['function'] . ': '; } foreach ($trace as $step) { $level .= '-'; if (isset($step['file'])) { $message .= $level . $msg . (isset($step['class']) ? $step['class'] : '') . (isset($step['type']) ? $step['type'] : '') . sprintf(_CORE_DEPRECATED_MSG, $step['function'], str_replace(array(ICMS_TRUST_PATH, ICMS_ROOT_PATH), array("TRUSTPATH", "ROOTPATH"), $step['file']), $step['line']); } $msg = _CORE_DEPRECATED_CALLEDBY; } $logger = icms_core_Logger::instance(); $logger->addDeprecated($pre . ($replacement ? ' <strong><em>' . sprintf(_CORE_DEPRECATED_REPLACEMENT, $replacement) . '</em></strong>.' : '') . ($extra ? ' <strong><em>' . $extra . '</em></strong>' : '') . _CORE_DEPRECATED_CALLSTACK . $message); }
/** * Constructor * @param object $object reference to targetobject (@link icms_ipf_Object) * @param string $key the form name */ public function __construct($object, $key) { icms_loadLanguageFile('system', 'blocksadmin', TRUE); parent::__construct(_AM_VISIBLEIN, ' ', $key . '_visiblein_tray'); $visible_label = new icms_form_elements_Label('', '<select name="visiblein[]" id="visiblein[]" multiple="multiple" size="10">' . $this->getPageSelOptions($object->getVar('visiblein')) . '</select>'); $this->addElement($visible_label); }
/** * Gets list of countries * * @return array $country_list list of countries */ public static function getCountryList() { icms_loadLanguageFile('core', 'countries'); $country_list = array("" => "-", "AD" => _COUNTRY_AD, "AE" => _COUNTRY_AE, "AF" => _COUNTRY_AF, "AG" => _COUNTRY_AG, "AI" => _COUNTRY_AI, "AL" => _COUNTRY_AL, "AM" => _COUNTRY_AM, "AN" => _COUNTRY_AN, "AO" => _COUNTRY_AO, "AQ" => _COUNTRY_AQ, "AR" => _COUNTRY_AR, "AS" => _COUNTRY_AS, "AT" => _COUNTRY_AT, "AU" => _COUNTRY_AU, "AW" => _COUNTRY_AW, "AX" => _COUNTRY_AX, "AZ" => _COUNTRY_AZ, "BA" => _COUNTRY_BA, "BB" => _COUNTRY_BB, "BD" => _COUNTRY_BD, "BE" => _COUNTRY_BE, "BF" => _COUNTRY_BF, "BG" => _COUNTRY_BG, "BH" => _COUNTRY_BH, "BI" => _COUNTRY_BI, "BJ" => _COUNTRY_BJ, "BL" => _COUNTRY_BL, "BM" => _COUNTRY_BM, "BN" => _COUNTRY_BN, "BO" => _COUNTRY_BO, "BQ" => _COUNTRY_BQ, "BR" => _COUNTRY_BR, "BS" => _COUNTRY_BS, "BT" => _COUNTRY_BT, "BV" => _COUNTRY_BV, "BW" => _COUNTRY_BW, "BY" => _COUNTRY_BY, "BZ" => _COUNTRY_BZ, "CA" => _COUNTRY_CA, "CC" => _COUNTRY_CC, "CD" => _COUNTRY_CD, "CF" => _COUNTRY_CF, "CG" => _COUNTRY_CG, "CH" => _COUNTRY_CH, "CI" => _COUNTRY_CI, "CK" => _COUNTRY_CK, "CL" => _COUNTRY_CL, "CM" => _COUNTRY_CM, "CN" => _COUNTRY_CN, "CO" => _COUNTRY_CO, "CR" => _COUNTRY_CR, "CU" => _COUNTRY_CU, "CV" => _COUNTRY_CV, "CX" => _COUNTRY_CX, "CY" => _COUNTRY_CY, "CZ" => _COUNTRY_CZ, "DE" => _COUNTRY_DE, "DJ" => _COUNTRY_DJ, "DK" => _COUNTRY_DK, "DM" => _COUNTRY_DM, "DO" => _COUNTRY_DO, "DZ" => _COUNTRY_DZ, "EC" => _COUNTRY_EC, "EE" => _COUNTRY_EE, "EG" => _COUNTRY_EG, "EH" => _COUNTRY_EH, "ER" => _COUNTRY_ER, "ES" => _COUNTRY_ES, "ET" => _COUNTRY_ET, "FI" => _COUNTRY_FI, "FJ" => _COUNTRY_FJ, "FK" => _COUNTRY_FK, "FM" => _COUNTRY_FM, "FO" => _COUNTRY_FO, "FR" => _COUNTRY_FR, "GA" => _COUNTRY_GA, "GB" => _COUNTRY_GB, "GD" => _COUNTRY_GD, "GE" => _COUNTRY_GE, "GF" => _COUNTRY_GF, "GG" => _COUNTRY_GG, "GH" => _COUNTRY_GH, "GI" => _COUNTRY_GI, "GL" => _COUNTRY_GL, "GM" => _COUNTRY_GM, "GN" => _COUNTRY_GN, "GP" => _COUNTRY_GP, "GQ" => _COUNTRY_GQ, "GR" => _COUNTRY_GR, "GS" => _COUNTRY_GS, "GT" => _COUNTRY_GT, "GU" => _COUNTRY_GU, "GW" => _COUNTRY_GW, "GY" => _COUNTRY_GY, "HK" => _COUNTRY_HK, "HM" => _COUNTRY_HM, "HN" => _COUNTRY_HN, "HR" => _COUNTRY_HR, "HT" => _COUNTRY_HT, "HU" => _COUNTRY_HU, "ID" => _COUNTRY_ID, "IE" => _COUNTRY_IE, "IL" => _COUNTRY_IL, "IM" => _COUNTRY_IM, "IN" => _COUNTRY_IN, "IO" => _COUNTRY_IO, "IQ" => _COUNTRY_IQ, "IR" => _COUNTRY_IR, "IS" => _COUNTRY_IS, "IT" => _COUNTRY_IT, "JE" => _COUNTRY_JE, "JM" => _COUNTRY_JM, "JO" => _COUNTRY_JO, "JP" => _COUNTRY_JP, "KE" => _COUNTRY_KE, "KG" => _COUNTRY_KG, "KH" => _COUNTRY_KH, "KI" => _COUNTRY_KI, "KM" => _COUNTRY_KM, "KN" => _COUNTRY_KN, "KP" => _COUNTRY_KP, "KR" => _COUNTRY_KR, "KW" => _COUNTRY_KW, "KY" => _COUNTRY_KY, "KZ" => _COUNTRY_KZ, "LA" => _COUNTRY_LA, "LB" => _COUNTRY_LB, "LC" => _COUNTRY_LC, "LI" => _COUNTRY_LI, "LK" => _COUNTRY_LK, "LR" => _COUNTRY_LR, "LS" => _COUNTRY_LS, "LT" => _COUNTRY_LT, "LU" => _COUNTRY_LU, "LV" => _COUNTRY_LV, "LY" => _COUNTRY_LY, "MA" => _COUNTRY_MA, "MC" => _COUNTRY_MC, "MD" => _COUNTRY_MD, "ME" => _COUNTRY_ME, "MF" => _COUNTRY_MF, "MG" => _COUNTRY_MG, "MH" => _COUNTRY_MH, "MK" => _COUNTRY_MK, "ML" => _COUNTRY_ML, "MM" => _COUNTRY_MM, "MN" => _COUNTRY_MN, "MO" => _COUNTRY_MO, "MP" => _COUNTRY_MP, "MQ" => _COUNTRY_MQ, "MR" => _COUNTRY_MR, "MS" => _COUNTRY_MS, "MT" => _COUNTRY_MT, "MU" => _COUNTRY_MU, "MV" => _COUNTRY_MV, "MW" => _COUNTRY_MW, "MX" => _COUNTRY_MX, "MY" => _COUNTRY_MY, "MZ" => _COUNTRY_MZ, "NA" => _COUNTRY_NA, "NC" => _COUNTRY_NC, "NE" => _COUNTRY_NE, "NF" => _COUNTRY_NF, "NG" => _COUNTRY_NG, "NI" => _COUNTRY_NI, "NL" => _COUNTRY_NL, "NO" => _COUNTRY_NO, "NP" => _COUNTRY_NP, "NR" => _COUNTRY_NR, "NU" => _COUNTRY_NU, "NZ" => _COUNTRY_NZ, "OM" => _COUNTRY_OM, "PA" => _COUNTRY_PA, "PE" => _COUNTRY_PE, "PF" => _COUNTRY_PF, "PG" => _COUNTRY_PG, "PH" => _COUNTRY_PH, "PK" => _COUNTRY_PK, "PL" => _COUNTRY_PL, "PM" => _COUNTRY_PM, "PN" => _COUNTRY_PN, "PR" => _COUNTRY_PR, "PS" => _COUNTRY_PS, "PT" => _COUNTRY_PT, "PW" => _COUNTRY_PW, "PY" => _COUNTRY_PY, "QA" => _COUNTRY_QA, "RE" => _COUNTRY_RE, "RO" => _COUNTRY_RO, "RS" => _COUNTRY_RS, "RU" => _COUNTRY_RU, "RW" => _COUNTRY_RW, "SA" => _COUNTRY_SA, "SB" => _COUNTRY_SB, "SC" => _COUNTRY_SC, "SD" => _COUNTRY_SD, "SE" => _COUNTRY_SE, "SG" => _COUNTRY_SG, "SH" => _COUNTRY_SH, "SI" => _COUNTRY_SI, "SJ" => _COUNTRY_SJ, "SK" => _COUNTRY_SK, "SL" => _COUNTRY_SL, "SM" => _COUNTRY_SM, "SN" => _COUNTRY_SN, "SO" => _COUNTRY_SO, "SR" => _COUNTRY_SR, "SS" => _COUNTRY_SS, "ST" => _COUNTRY_ST, "SV" => _COUNTRY_SV, "SX" => _COUNTRY_SX, "SY" => _COUNTRY_SY, "SZ" => _COUNTRY_SZ, "TC" => _COUNTRY_TC, "TD" => _COUNTRY_TD, "TF" => _COUNTRY_TF, "TG" => _COUNTRY_TG, "TH" => _COUNTRY_TH, "TJ" => _COUNTRY_TJ, "TK" => _COUNTRY_TK, "TL" => _COUNTRY_TL, "TM" => _COUNTRY_TM, "TN" => _COUNTRY_TN, "TO" => _COUNTRY_TO, "TR" => _COUNTRY_TR, "TT" => _COUNTRY_TT, "TV" => _COUNTRY_TV, "TW" => _COUNTRY_TW, "TZ" => _COUNTRY_TZ, "UA" => _COUNTRY_UA, "UG" => _COUNTRY_UG, "UK" => _COUNTRY_UK, "UM" => _COUNTRY_UM, "US" => _COUNTRY_US, "UY" => _COUNTRY_UY, "UZ" => _COUNTRY_UZ, "VA" => _COUNTRY_VA, "VC" => _COUNTRY_VC, "VE" => _COUNTRY_VE, "VG" => _COUNTRY_VG, "VI" => _COUNTRY_VI, "VN" => _COUNTRY_VN, "VU" => _COUNTRY_VU, "WF" => _COUNTRY_WF, "WS" => _COUNTRY_WS, "YE" => _COUNTRY_YE, "YT" => _COUNTRY_YT, "ZA" => _COUNTRY_ZA, "ZM" => _COUNTRY_ZM, "ZW" => _COUNTRY_ZW); asort($country_list); reset($country_list); return $country_list; }
/** * Constructor * @param object $object reference to targetobject (@link icms_ipf_Object) * @param string $key the form name */ public function __construct($object, $key) { $var = $object->vars[$key]; $control = $object->controls[$key]; icms_loadLanguageFile('core', 'user'); parent::__construct($var['form_caption'] . '<br />' . _US_TYPEPASSTWICE, ' ', $key . '_password_tray'); $password_box1 = new icms_form_elements_Password('', $key . '1', 10, 32, '', FALSE, "password_adv"); $this->addElement($password_box1); $this->_key = $key; }
public function __construct() { icms_loadLanguageFile('core', 'xoopsmailerlocal'); if (class_exists('XoopsMailerLocal')) { $this->multimailer = new XoopsMailerLocal(); } else { $this->multimailer = new icms_messaging_Handler(); } $this->reset(); }
/** * Constructor * @param object $object reference to targetobject (@link icms_ipf_Object) * @param string $key the form name */ public function __construct($object, $key) { $var = $object->vars[$key]; parent::__construct($var['form_caption'], '<br /><br />', $key . '_signature_tray'); icms_loadLanguageFile('core', 'user'); $signature_textarea = new icms_form_elements_Dhtmltextarea('', $key, $object->getVar($key, 'e')); $this->addElement($signature_textarea); $attach_checkbox = new icms_form_elements_Checkbox('', 'attachsig', $object->getVar('attachsig', 'e')); $attach_checkbox->addOption(1, _US_SHOWSIG); $this->addElement($attach_checkbox); }
function b_profile_usermenu_show($options) { global $icmsConfigUser; if (!is_object(icms::$user)) { return; } icms_loadLanguageFile(basename(dirname(dirname(__FILE__))), 'modinfo'); $block = array(); $dirname = basename(dirname(dirname(__FILE__))); $config_handler = icms::handler('icms_config'); $privmessage_handler = icms::handler('icms_data_privmessage'); $module = icms::handler('icms_module')->getByDirname($dirname, TRUE); $criteria = new icms_db_criteria_Compo(); $criteria->add(new icms_db_criteria_Item('read_msg', 0)); $criteria->add(new icms_db_criteria_Item('to_userid', icms::$user->getVar('uid'))); $newmsg = $privmessage_handler->getCount($criteria); $i = 0; if (icms::$user->isAdmin()) { $block[++$i]['name'] = _MB_SYSTEM_ADMENU; $block[$i]['url'] = ICMS_URL . "/admin.php"; } $block[++$i]['name'] = _MB_SYSTEM_VACNT; $block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/" . ($module->config['profile_social'] ? "index.php?uid=" . icms::$user->getVar('uid') : "userinfo.php?uid=" . icms::$user->getVar('uid')); $block[++$i]['name'] = _MB_SYSTEM_INBOX; $block[$i]['url'] = ICMS_URL . "/viewpmsg.php"; $block[$i]['extra'] = $newmsg; $block[++$i]['name'] = _MB_SYSTEM_NOTIF; $block[$i]['url'] = ICMS_URL . "/notifications.php"; if ($module->config['profile_social']) { $block[++$i]['name'] = _MI_PROFILE_SEARCH; $block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/search.php"; } $block[++$i]['name'] = _MI_PROFILE_EDITACCOUNT; $block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/edituser.php"; $block[++$i]['name'] = _MI_PROFILE_CHANGEPASS; $block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/changepass.php"; if ($icmsConfigUser['allow_chgmail']) { $block[++$i]['name'] = _MI_PROFILE_CHANGEMAIL; $block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/changemail.php"; } if ($icmsConfigUser['self_delete']) { $block[++$i]['name'] = _MI_PROFILE_DELETEACCOUNT; $block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/edituser.php?op=delete"; } if ($module->config['profile_social']) { $block[++$i]['name'] = _MI_PROFILE_MYCONFIGS; $block[$i]['url'] = ICMS_URL . "/modules/" . $dirname . "/configs.php"; } $block[++$i]['name'] = _MB_SYSTEM_LOUT; $block[$i]['url'] = ICMS_URL . "/user.php?op=logout"; return $block; }
/** * Constructor * @param object $object reference to targetobject (@link icms_ipf_Object) * @param string $key the form name */ public function __construct($object, $key) { $var = $object->vars[$key]; parent::__construct($var['form_caption'], ' ', 'options_tray'); $func = $object->getVar('edit_func'); require_once ICMS_ROOT_PATH . "/modules/" . $object->handler->getModuleDirname($object->getVar('mid', 'e')) . "/blocks/" . $object->getVar('func_file'); icms_loadLanguageFile($object->handler->getModuleDirname($object->getVar('mid', 'e')), 'blocks'); if (!function_exists($func)) { return; } $visible_label = new icms_form_elements_Label('', $func(explode('|', $object->getVar('options')))); $this->addElement($visible_label); }
/** * Provides a backtrace for deprecated methods and functions, will be in the error section of debug * This takes the place of icms_deprecated() * * @param string $replacement Method or function to be used instead of the deprecated method or function * @param string $extra Additional information to provide about the change */ public static function setDeprecated($replacement = '', $extra = '') { icms_loadLanguageFile('core', 'core'); $trace = debug_backtrace(); array_shift($trace); $level = $msg = $message = ''; $pre = '<strong><em>(' . _CORE_DEPRECATED . ')</em></strong> - '; if ($trace[0]['function'] != 'include' && $trace[0]['function'] != 'include_once' && $trace[0]['function'] != 'require' && $trace[0]['function'] != 'require_once') { $pre .= $trace[0]['function'] . ': '; } foreach ($trace as $step) { $level .= '-'; if (isset($step['file'])) { $message .= $level . $msg . (isset($step['class']) ? $step['class'] : '') . (isset($step['type']) ? $step['type'] : '') . sprintf(_CORE_DEPRECATED_MSG, $step['function'], str_replace(array(ICMS_TRUST_PATH, ICMS_ROOT_PATH), array("TRUSTPATH", "ROOTPATH"), $step['file']), $step['line']); } $msg = _CORE_DEPRECATED_CALLEDBY; } $logger = icms_core_Logger::instance(); $logger->addDeprecated($pre . ($replacement ? ' <strong><em>' . sprintf(_CORE_DEPRECATED_REPLACEMENT, $replacement) . '</em></strong>.' : '') . ($extra ? ' <strong><em>' . $extra . '</em></strong>' : '') . _CORE_DEPRECATED_CALLSTACK . $message); }
/** * Get a reference to the only instance of database class and connects to DB * * if the class has not been instantiated yet, this will also take * care of that * * @static * @staticvar object The only instance of database class * @return object Reference to the only instance of database class */ public static function &instance() { static $instance; if (!isset($instance)) { if (defined('XOOPS_DB_ALTERNATIVE') && class_exists(XOOPS_DB_ALTERNATIVE)) { $class = XOOPS_DB_ALTERNATIVE; } elseif (!defined('XOOPS_DB_PROXY')) { $class = 'icms_db_legacy_' . XOOPS_DB_TYPE . '_Safe'; } else { $class = 'icms_db_legacy_' . XOOPS_DB_TYPE . '_Proxy'; } $instance = new $class(); $instance->setLogger(icms_core_Logger::instance()); $instance->setPrefix(XOOPS_DB_PREFIX); if (!$instance->connect()) { icms_loadLanguageFile('core', 'core'); trigger_error(_CORE_DB_NOTRACEDB, E_USER_ERROR); } } return $instance; }
/** * Constructor * * @param string $caption * @param string $name * @param mixed $value Pre-selected value (or array of them). * For an item with massive members, such as "Registered Users", "$value" should be used to store selected temporary users only instead of all members of that item * @param bool $include_anon Include user "anonymous"? * @param int $size Number or rows. "1" makes a drop-down-list. * @param bool $multiple Allow multiple selections? */ public function __construct($caption, $name, $include_anon = FALSE, $value = NULL, $size = 1, $multiple = FALSE, $showremovedusers = FALSE, $justremovedusers = FALSE) { $limit = 200; $select_element = new icms_form_elements_Select('', $name, $value, $size, $multiple); if ($include_anon) { $select_element->addOption(0, $GLOBALS['icmsConfig']['anonymous']); } $member_handler = icms::handler('icms_member'); $user_count = $member_handler->getUserCount(); $value = is_array($value) ? $value : (empty($value) ? array() : array($value)); if ($user_count > $limit && count($value) > 0) { $criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item("uid", "(" . implode(",", $value) . ")", "IN")); } else { $criteria = new icms_db_criteria_Compo(); $criteria->setLimit($limit); } $criteria->setSort('uname'); if (!$showremovedusers) { $criteria->add(new icms_db_criteria_Item('level', '-1', '!=')); } elseif ($showremovedusers && $justremovedusers) { $criteria->add(new icms_db_criteria_Item('level', '-1')); } $criteria->setOrder('ASC'); $users = $member_handler->getUserList($criteria); $select_element->addOptionArray($users); if ($user_count <= $limit) { parent::__construct($caption, "", $name); $this->addElement($select_element); return; } icms_loadLanguageFile('core', 'findusers'); $js_addusers = "<script type=\"text/javascript\">\r\n\t\t\t\t\tfunction addusers(opts){\r\n\t\t\t\t\t\tvar num = opts.substring(0, opts.indexOf(\":\"));\r\n\t\t\t\t\t\topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n\t\t\t\t\t\tvar sel = xoopsGetElementById(\"" . $name . ($multiple ? "[]" : "") . "\");\r\n\t\t\t\t\t\tvar arr = new Array(num);\r\n\t\t\t\t\t\tfor (var n=0; n < num; n++) {\r\n\t\t\t\t\t\t\tvar nm = opts.substring(0, opts.indexOf(\":\"));\r\n\t\t\t\t\t\t\topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n\t\t\t\t\t\t\tvar val = opts.substring(0, opts.indexOf(\":\"));\r\n\t\t\t\t\t\t\topts = opts.substring(opts.indexOf(\":\")+1, opts.length);\r\n\t\t\t\t\t\t\tvar txt = opts.substring(0, nm - val.length);\r\n\t\t\t\t\t\t\topts = opts.substring(nm - val.length, opts.length);\r\n\t\t\t\t\t\t\tvar added = false;\r\n\t\t\t\t\t\t\tfor (var k = 0; k < sel.options.length; k++) {\r\n\t\t\t\t\t\t\t\tif (sel.options[k].value == val){\r\n\t\t\t\t\t\t\t\t\tadded = true;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (added == false) {\r\n\t\t\t\t\t\t\t\tsel.options[k] = new Option(txt, val);\r\n\t\t\t\t\t\t\t\tsel.options[k].selected = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t</script>"; $token = icms::$security->createToken(); $action_tray = new icms_form_elements_Tray("", " | "); $action_tray->addElement(new icms_form_elements_Label('', "<a href='#' onclick='var sel = xoopsGetElementById(\"" . $name . ($multiple ? "[]" : "") . "\");for (var i = sel.options.length-1; i >= 0; i--) {if (!sel.options[i].selected) {sel.options[i] = null;}}; return false;'>" . _MA_USER_REMOVE . "</a>")); $action_tray->addElement(new icms_form_elements_Label('', "<a href='#' onclick='openWithSelfMain(\"" . ICMS_URL . "/include/findusers.php?target={$name}&multiple={$multiple}&token={$token}\", \"userselect\", 800, 600, null); return false;' >" . _MA_USER_MORE . "</a>" . $js_addusers)); parent::__construct($caption, '<br /><br />', $name); $this->addElement($select_element); $this->addElement($action_tray); }
/** * Constructor * * Initiate the object, based on $icmsModule * * @param string $aboutTitle text used in the extreme right caption of the menu * @return icms_ipf_About */ public function __construct($aboutTitle = _MODABOUT_ABOUT) { global $icmsModule, $icmsConfig; icms_loadLanguageFile($icmsModule->getVar("dirname"), 'modinfo'); icms_loadLanguageFile('core', 'moduleabout'); $this->_aboutTitle = $aboutTitle; $this->_lang_developer_contributor = _MODABOUT_DEVELOPER_CONTRIBUTOR; $this->_lang_developer_website = _MODABOUT_DEVELOPER_WEBSITE; $this->_lang_developer_email = _MODABOUT_DEVELOPER_EMAIL; $this->_lang_developer_credits = _MODABOUT_DEVELOPER_CREDITS; $this->_lang_module_info = _MODABOUT_MODULE_INFO; $this->_lang_module_status = _MODABOUT_MODULE_STATUS; $this->_lang_module_release_date = _MODABOUT_MODULE_RELEASE_DATE; $this->_lang_module_demo = _MODABOUT_MODULE_DEMO; $this->_lang_module_support = _CO_ICMS_MODULE_SUPPORT; $this->_lang_module_bug = _MODABOUT_MODULE_BUG; $this->_lang_module_submit_bug = _MODABOUT_MODULE_SUBMIT_BUG; $this->_lang_module_feature = _MODABOUT_MODULE_FEATURE; $this->_lang_module_submit_feature = _CO_ICMS_MODULE_SUBMIT_FEATURE; $this->_lang_module_disclaimer = _MODABOUT_MODULE_DISCLAIMER; $this->_lang_author_word = _MODABOUT_AUTHOR_WORD; $this->_lang_version_history = _MODABOUT_VERSION_HISTORY; }
/** * Generates a pdf file * * @param string $content The content to put in the PDF file * @param string $doc_title The title for the PDF file * @param string $doc_keywords The keywords to put in the PDF file * @return string Generated output by the pdf (@link TCPDF) class */ function Generate_PDF($content, $doc_title, $doc_keywords) { global $icmsConfig; require_once ICMS_PDF_LIB_PATH . '/tcpdf.php'; icms_loadLanguageFile('core', 'pdf'); $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor(PDF_AUTHOR); $pdf->SetTitle($doc_title); $pdf->SetSubject($doc_title); $pdf->SetKeywords($doc_keywords); $sitename = $icmsConfig['sitename']; $siteslogan = $icmsConfig['slogan']; $pdfheader = icms_core_DataFilter::undoHtmlSpecialChars($sitename . ' - ' . $siteslogan); $pdf->SetHeaderData("logo.gif", PDF_HEADER_LOGO_WIDTH, $pdfheader, ICMS_URL); //set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); //set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); //set image scale factor $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); $pdf->setLanguageArray($l); //set language items // set font $TextFont = @_PDF_LOCAL_FONT && file_exists(ICMS_PDF_LIB_PATH . '/fonts/' . _PDF_LOCAL_FONT . '.php') ? _PDF_LOCAL_FONT : 'dejavusans'; $pdf->SetFont($TextFont); //initialize document $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->writeHTML($content, true, 0); return $pdf->Output(); }
* @copyright http://www.impresscms.org/ The ImpressCMS Project * @license LICENSE.txt * @package core * @since XOOPS * @author http://www.xoops.org The XOOPS Project * @author modified by UnderDog <*****@*****.**> * @version $Id: comment_reply.php 22037 2011-07-15 13:02:29Z mcdonald3072 $ */ if (!defined('ICMS_ROOT_PATH') || !is_object($icmsModule)) { exit; } include_once ICMS_INCLUDE_PATH . '/comment_constants.php'; if ('system' != $icmsModule->getVar('dirname') && XOOPS_COMMENT_APPROVENONE == $icmsModuleConfig['com_rule'] || !is_object(icms::$user) && !$icmsModuleConfig['com_anonpost'] || !is_object($icmsModule)) { redirect_header(ICMS_URL . '/user.php', 1, _NOPERM); } icms_loadLanguageFile('core', 'comment'); $com_id = isset($_GET['com_id']) ? (int) $_GET['com_id'] : 0; $com_mode = isset($_GET['com_mode']) ? htmlspecialchars(trim($_GET['com_mode']), ENT_QUOTES) : ''; if ($com_mode == '') { if (is_object(icms::$user)) { $com_mode = icms::$user->getVar('umode'); } else { $com_mode = $icmsConfig['com_mode']; } } if (!isset($_GET['com_order'])) { if (is_object(icms::$user)) { $com_order = icms::$user->getVar('uorder'); } else { $com_order = $icmsConfig['com_order']; }
/** * Gathers and displays the current user's bookmarks * @since 1.2 * @return array Array of bookmark links for the current user */ function b_system_bookmarks_show() { global $icmsConfig; $block = array(); icms_loadLanguageFile('core', 'notification'); // User must be logged in if (empty(icms::$user)) { return FALSE; // do not display block } // Get an array of all notifications for the selected user $notification_handler = icms::handler('icms_data_notification'); $notifications =& $notification_handler->getByUser(icms::$user->getVar('uid')); // Generate the info for the template $module_handler = icms::handler('icms_module'); $prev_modid = -1; $prev_item = -1; foreach ($notifications as $n) { $modid = $n->getVar('not_modid'); if ($modid != $prev_modid) { $prev_modid = $modid; $prev_item = -1; $module =& $module_handler->get($modid); $module_name = $module->getVar('name'); // Get the lookup function, if exists $not_config = $module->getInfo('notification'); $lookup_func = ''; if (!empty($not_config['lookup_file'])) { $lookup_file = ICMS_MODULES_PATH . '/' . $module->getVar('dirname') . '/' . $not_config['lookup_file']; if (file_exists($lookup_file)) { include_once $lookup_file; if (!empty($not_config['lookup_func']) && function_exists($not_config['lookup_func'])) { $lookup_func = $not_config['lookup_func']; } } } } $category = $n->getVar('not_category'); $item = $n->getVar('not_itemid'); if ($item != $prev_item) { $prev_item = $item; if (!empty($lookup_func)) { $item_info = $lookup_func($category, $item); } else { $item_info = array('name'=>'[' . _NOT_NAMENOTAVAILABLE . ']', 'url'=>''); } } if ($n->getVar('not_event') == 'bookmark') { $block[$module_name][] = array('name'=>$item_info['name'], 'url'=>$item_info['url']); } } return $block; }
* See the enclosed file license.txt for licensing information. * If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html * * @copyright The ImpressCMS project http://www.impresscms.org/ * @license http://www.fsf.org/copyleft/gpl.html GNU General Public License (GPL) * @package installer * @since 1.0 * @author Kazumi Ono (AKA onokazu) * @author RpLima * @author Martijn Hertog (AKA wtravel) <*****@*****.**> * @version $Id: modulesadmin.php 22529 2011-09-02 19:55:40Z phoenyx $ */ /** * */ icms_loadLanguageFile('system', 'modulesadmin', true); function xoops_module_install($dirname) { $dirname = trim($dirname); $db =& icms_db_Factory::instance(); $reservedTables = array('avatar', 'avatar_users_link', 'block_module_link', 'xoopscomments', 'config', 'configcategory', 'configoption', 'image', 'imagebody', 'imagecategory', 'imgset', 'imgset_tplset_link', 'imgsetimg', 'groups', 'groups_users_link', 'group_permission', 'online', 'bannerclient', 'banner', 'bannerfinish', 'priv_msgs', 'ranks', 'session', 'smiles', 'users', 'newblocks', 'modules', 'tplfile', 'tplset', 'tplsource', 'xoopsnotifications', 'banner', 'bannerclient', 'bannerfinish'); $module_handler = icms::handler('icms_module'); if ($module_handler->getCount(new icms_db_criteria_Item('dirname', $dirname)) == 0) { $module =& $module_handler->create(); $module->loadInfoAsVar($dirname); $module->registerClassPath(); $module->setVar('weight', 1); $error = false; $errs = array(); $sqlfile =& $module->getInfo('sqlfile'); $msgs = array();
* * Currently there are two types of CAPTCHA forms, text and image * The default mode is "text", it can be changed in the priority: * 1 If mode is set through icms_form_elements_Captcha::setConfig("mode", $mode), take it * 2 Elseif mode is set though captcha/config.php, take it * 3 Else, take "text" * * @copyright http://www.impresscms.org/ The ImpressCMS Project * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License (GPL) * @category ICMS * @package Form * @subpackage Elements * @author Sina Asghari (aka stranger) <*****@*****.**> * @version SVN: $Id: Object.php 20424 2010-11-20 19:16:00Z phoenyx $ */ icms_loadLanguageFile('core', 'captcha'); /** * Creates the captcha object * * @category ICMS * @package Form * @subpackage Elements * */ class icms_form_elements_captcha_Object { public $active = TRUE; /** potential values: image, text */ public $mode = "text"; /** */ public $config = array();
/** * Function to be triggered at the end of the core boot process */ function eventFinishCoreBoot() { icms_loadLanguageFile("system", "customtag", TRUE); }
$user = $member_handler->getUser($uid); } else { $user = $member_handler->createUser(); $user->setVar('user_regdate', time()); $user->setVar('user_avatar', 'blank.gif'); $user->setVar('uorder', $icmsConfig['com_order']); $user->setVar('umode', $icmsConfig['com_mode']); } $errors = array(); $stop = ''; $login_name = isset($_POST['login_name']) ? trim($_POST['login_name']) : ''; $uname = isset($_POST['uname']) ? trim($_POST['uname']) : ''; $email = isset($_POST['email']) ? trim($_POST['email']) : ''; $pass = isset($_POST['password']) ? icms_core_DataFilter::stripSlashesGPC($_POST['password']) : ''; $vpass = isset($_POST['vpass']) ? icms_core_DataFilter::stripSlashesGPC($_POST['vpass']) : ''; icms_loadLanguageFile('core', 'user'); $stop .= icms::handler('icms_member_user')->userCheck($login_name, $uname, $email, !$user->isNew() && $pass == '' ? false : $pass, $vpass, $user->isNew() ? 0 : $user->getVar('uid')); if ($user->getVar('uid') != icms::$user->getVar('uid')) { if ($pass != '') { $icmspass = new icms_core_Password(); $salt = icms_core_Password::createSalt(); $pass = $icmspass->encryptPass($pass, $salt, $icmsConfigUser['enc_type']); $user->setVar('pass', $pass); $user->setVar('pass_expired', 0); $user->setVar('enc_type', $icmsConfigUser['enc_type']); $user->setVar('salt', $salt); } $user->setVar('level', (int) $_POST['level']); } $user->setVar('uname', $uname); $user->setVar('login_name', $login_name);
/** * Constructor * * @param string $uploadDir * @param array $allowedMimeTypes * @param int $maxFileSize * @param int $maxWidth * @param int $maxHeight */ public function __construct($uploadDir, $allowedMimeTypes, $maxFileSize = 0, $maxWidth = null, $maxHeight = null) { $this->extensionToMime = icms_Utils::mimetypes(); if (!is_array($this->extensionToMime)) { $this->extensionToMime = array(); return false; } if (is_array($allowedMimeTypes)) { $this->allowedMimeTypes =& $allowedMimeTypes; } $this->uploadDir = $uploadDir; $this->maxFileSize = (int) $maxFileSize; if (isset($maxWidth)) { $this->maxWidth = (int) $maxWidth; } if (isset($maxHeight)) { $this->maxHeight = (int) $maxHeight; } icms_loadLanguageFile('core', 'uploader'); }
* @version SVN: $Id: main.php 11285 2011-06-23 16:37:07Z phoenyx $ */ if (!is_object(icms::$user) || !is_object($icmsModule) || !icms::$user->isAdmin($icmsModule->getVar('mid'))) { exit("Access Denied"); } else { if (!empty($_POST)) foreach ($_POST as $k => $v) ${$k} = StopXSS($v); if (!empty($_GET)) foreach ($_GET as $k => $v) ${$k} = StopXSS($v); $op = (isset($_GET['op'])) ? trim(filter_input(INPUT_GET, 'op')) : ((isset($_POST['op'])) ? trim(filter_input(INPUT_POST, 'op')) : 'list' ); if ($op == 'list') { icms_loadLanguageFile('system', 'preferences', TRUE); icms_cp_header(); echo '<div class="CPbigTitle" style="background-image: url(' . ICMS_URL . '/modules/system/admin/avatars/images/avatars_big.png)">' . _MD_AVATARMAN . '</div><br />'; $avt_handler = icms::handler('icms_data_avatar'); $savatar_count = $avt_handler->getCount(new icms_db_criteria_Item('avatar_type', 'S')); $cavatar_count = $avt_handler->getCount(new icms_db_criteria_Item('avatar_type', 'C')); echo '<ul><li>' . _MD_SYSAVATARS . ' (' . sprintf(_NUMIMAGES, '<strong>' . icms_conv_nr2local($savatar_count) . '</strong>') . ') [<a href="admin.php?fct=avatars&op=listavt&type=S">' . _LIST . '</a>]</li><li>' . _MD_CSTAVATARS . ' (' . sprintf(_NUMIMAGES, '<strong>' . icms_conv_nr2local($cavatar_count) . '</strong>') . ') [<a href="admin.php?fct=avatars&op=listavt&type=C">' . _LIST . '</a>]</li></ul>'; $form = new icms_form_Theme(_MD_ADDAVT, 'avatar_form', 'admin.php', "post", TRUE); $form->setExtra('enctype="multipart/form-data"');
/** * Automatic update of the system module * * @param object $module reference to the module object * @param int $oldversion The old version of the database * @param int $dbVersion The database version * @return mixed */ function xoops_module_update_system(&$module, $oldversion = NULL, $dbVersion = NULL) { global $icmsConfig, $xoTheme; $from_112 = $abortUpdate = FALSE; $oldversion = $module->getVar('version'); if ($oldversion < 120) { $result = icms::$xoopsDB->query("SELECT t1.tpl_id FROM " . icms::$xoopsDB->prefix('tplfile') . " t1, " . icms::$xoopsDB->prefix('tplfile') . " t2 WHERE t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_id > t2.tpl_id"); $tplids = array(); while (list($tplid) = icms::$xoopsDB->fetchRow($result)) { $tplids[] = $tplid; } if (count($tplids) > 0) { $tplfile_handler = icms::handler('icms_view_template_file'); $duplicate_files = $tplfile_handler->getObjects(new icms_db_criteria_Item('tpl_id', "(" . implode(',', $tplids) . ")", "IN")); if (count($duplicate_files) > 0) { foreach (array_keys($duplicate_files) as $i) { $tplfile_handler->delete($duplicate_files[$i]); } } } } $icmsDatabaseUpdater = icms_db_legacy_Factory::getDatabaseUpdater(); //$dbVersion = $module->getDBVersion(); //$oldversion = $module->getVar('version'); ob_start(); $dbVersion = $module->getDBVersion(); echo sprintf(_DATABASEUPDATER_CURRENTVER, icms_conv_nr2local($dbVersion)) . '<br />'; echo "<code>" . sprintf(_DATABASEUPDATER_UPDATE_TO, icms_conv_nr2local(ICMS_SYSTEM_DBVERSION)) . "<br />"; /* * DEVELOPER, PLEASE NOTE !!! * * Everytime we add a new upgrade block here, the dbversion of the System Module will get * incremented. It is very important to modify the ICMS_SYSTEM_DBVERSION accordingly * in htdocs/include/version.php * * When we start a new major release, move all the previous version's upgrade scripts to * a separate file, to minimize file size and memory usage */ $CleanWritingFolders = FALSE; if ($dbVersion < 40) { include 'update-112-to-122.php'; } /* Begin upgrade to version 1.3 */ if (!$abortUpdate) { $newDbVersion = 41; } if ($dbVersion < $newDbVersion) { /* Add new tables and data for the help suggestions and quick search */ $table = new icms_db_legacy_updater_Table('autosearch_cat'); if (!$table->exists()) { $table->setStructure("`cid` int(11) NOT NULL auto_increment,\n\t\t\t\t `cat_name` varchar(255) NOT NULL,\n\t\t\t\t `cat_url` text NOT NULL,\n\t\t\t\t PRIMARY KEY (`cid`)"); if (!$table->createTable()) { $abortUpdate = TRUE; $newDbVersion = 40; } if (!$abortUpdate) { icms_loadLanguageFile('system', 'admin'); $search_cats = array("NULL, '" . _MD_AM_ADSENSES . "', '/modules/system/admin.php?fct=adsense'", "NULL, '" . _MD_AM_AUTOTASKS . "', '/modules/system/admin.php?fct=autotasks'", "NULL, '" . _MD_AM_AVATARS . "', '/modules/system/admin.php?fct=avatars'", "NULL, '" . _MD_AM_BANS . "', '/modules/system/admin.php?fct=banners'", "NULL, '" . _MD_AM_BKPOSAD . "', '/modules/system/admin.php?fct=blockspadmin'", "NULL, '" . _MD_AM_BKAD . "', '/modules/system/admin.php?fct=blocksadmin'", "NULL, '" . _MD_AM_COMMENTS . "', '/modules/system/admin.php?fct=comments'", "NULL, '" . _MD_AM_CUSTOMTAGS . "', '/modules/system/admin.php?fct=customtag'", "NULL, '" . _MD_AM_USER . "', '/modules/system/admin.php?fct=users'", "NULL, '" . _MD_AM_FINDUSER . "', '/modules/system/admin.php?fct=finduser'", "NULL, '" . _MD_AM_ADGS . "', '/modules/system/admin.php?fct=groups'", "NULL, '" . _MD_AM_IMAGES . "', '/modules/system/admin.php?fct=images'", "NULL, '" . _MD_AM_MLUS . "', '/modules/system/admin.php?fct=mailusers'", "NULL, '" . _MD_AM_MIMETYPES . "', '/modules/system/admin.php?fct=mimetype'", "NULL, '" . _MD_AM_MDAD . "', '/modules/system/admin.php?fct=modulesadmin'", "NULL, '" . _MD_AM_PREF . "', '/modules/system/admin.php?fct=preferences'", "NULL, '" . _MD_AM_RATINGS . "', '/modules/system/admin.php?fct=rating'", "NULL, '" . _MD_AM_SMLS . "', '/modules/system/admin.php?fct=smilies'", "NULL, '" . _MD_AM_PAGES . "', '/modules/system/admin.php?fct=pages'", "NULL, '" . _MD_AM_TPLSETS . "', '/modules/system/admin.php?fct=tplsets'", "NULL, '" . _MD_AM_RANK . "', '/modules/system/admin.php?fct=userrank'", "NULL, '" . _MD_AM_VERSION . "', '/modules/system/admin.php?fct=version'"); foreach ($search_cats as $cat) { $table->setData($cat); } $table->addData(); } unset($table); } $table = new icms_db_legacy_updater_Table('autosearch_list'); if (!$table->exists() && !$abortUpdate) { $table->setStructure("`id` int(11) NOT NULL auto_increment,\n\t\t\t\t `cat_id` int(11) NOT NULL,\n\t\t\t\t `name` varchar(255) NOT NULL,\n\t\t\t\t `img` varchar(255) NOT NULL,\n\t\t\t\t `desc` text NOT NULL,\n\t\t\t\t `url` text NOT NULL,\n\t\t\t\t PRIMARY KEY (`id`)"); if (!$table->createTable()) { $abortUpdate = TRUE; $newDbVersion = 40; } if (!$abortUpdate) { icms_loadLanguageFile('system', 'admin'); icms_loadLanguageFile('system', 'preferences', TRUE); $search_items = array("NULL, 1, '" . _MD_AM_ADSENSES . "', '/modules/system/admin/adsense/images/adsense_small.png', '" . _MD_AM_ADSENSES_DSC . "', '/modules/system/admin.php?fct=adsense'", "NULL, 2, '" . _MD_AM_AUTOTASKS . "', '/modules/system/admin/autotasks/images/autotasks_small.png', '" . _MD_AM_AUTOTASKS_DSC . "', '/modules/system/admin.php?fct=autotasks'", "NULL, 3, '" . _MD_AM_AVATARS . "', '/modules/system/admin/avatars/images/avatars_small.png', '" . _MD_AM_AVATARS_DSC . "', '/modules/system/admin.php?fct=avatars'", "NULL, 4, '" . _MD_AM_BANS . "', '/modules/system/admin/banners/images/banners_small.png', '" . _MD_AM_BANS_DSC . "', '/modules/system/admin.php?fct=banners'", "NULL, 5, '" . _MD_AM_BKPOSAD . "', '/modules/system/admin/blockspadmin/images/blockspadmin_small.png', '" . _MD_AM_BKPOSAD_DSC . "', '/modules/system/admin.php?fct=blockspadmin'", "NULL, 6, '" . _MD_AM_BKAD . "', '/modules/system/admin/blocksadmin/images/blocksadmin_small.png', '" . _MD_AM_BKAD_DSC . "', '/modules/system/admin.php?fct=blocksadmin'", "NULL, 7, '" . _MD_AM_COMMENTS . "', '/modules/system/admin/comments/images/comments_small.png', '" . _MD_AM_COMMENTS_DSC . "', '/modules/system/admin.php?fct=comments'", "NULL, 8, '" . _MD_AM_CUSTOMTAGS . "', '/modules/system/admin/customtag/images/customtag_small.png', '" . _MD_AM_CUSTOMTAGS_DSC . "', '/modules/system/admin.php?fct=customtag'", "NULL, 9, '" . _MD_AM_USER . "', '/modules/system/admin/users/images/users_small.png', '" . _MD_AM_USER_DSC . "', '/modules/system/admin.php?fct=users'", "NULL, 10, '" . _MD_AM_FINDUSER . "', '/modules/system/admin/findusers/images/findusers_small.png', '" . _MD_AM_FINDUSER_DSC . "', '/modules/system/admin.php?fct=findusers'", "NULL, 11, '" . _MD_AM_ADGS . "', '/modules/system/admin/groups/images/groups_small.png', '" . _MD_AM_ADGS_DSC . "', '/modules/system/admin.php?fct=groups'", "NULL, 12, '" . _MD_AM_IMAGES . "', '/modules/system/admin/images/images/images_small.png', '" . _MD_AM_IMAGES_DSC . "', '/modules/system/admin.php?fct=images'", "NULL, 13, '" . _MD_AM_MLUS . "', '/modules/system/admin/mailusers/images/mailusers_small.png', '" . _MD_AM_MLUS_DSC . "', '/modules/system/admin.php?fct=mailusers'", "NULL, 14, '" . _MD_AM_MIMETYPES . "', '/modules/system/admin/mimetype/images/mimetype_small.png', '" . _MD_AM_MIMETYPES_DSC . "', '/modules/system/admin.php?fct=mimetype'", "NULL, 15, '" . _MD_AM_MDAD . "', '/modules/system/admin/modulesadmin/images/modulesadmin_small.png', '" . _MD_AM_MDAD_DSC . "', '/modules/system/admin.php?fct=modulesadmin'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_AUTHENTICATION . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_AUTHENTICATION_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=7'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_AUTOTASKS . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_AUTOTASKS_PREF_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=13'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_CAPTCHA . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_CAPTCHA_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=11'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_GENERAL . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_GENERAL_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=1'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_PURIFIER . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_PURIFIER_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=14'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_MAILER . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_MAILER_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=6'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_METAFOOTER . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_METAFOOTER_DSC . "', '/modules/system/admin/preferences/images/preferences_small.png'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_MULTILANGUAGE . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_MULTILANGUAGE_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=8'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_PERSON . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_PERSON_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=10'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_PLUGINS . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_PLUGINS_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=12'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_SEARCH . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_SEARCH_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=5'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_USERSETTINGS . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_USERSETTINGS_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=2'", "NULL, 16, '" . _MD_AM_PREF . " - " . _MD_AM_CENSOR . "', '/modules/system/admin/preferences/images/preferences_small.png', '" . _MD_AM_CENSOR_DSC . "', '/modules/system/admin.php?fct=preferences&op=show&confcat_id=4'", "NULL, 17, '" . _MD_AM_RATINGS . "', '/modules/system/admin/rating/images/rating_small.png', '" . _MD_AM_RATINGS_DSC . "', '/modules/system/admin.php?fct=rating'", "NULL, 18, '" . _MD_AM_SMLS . "', '/modules/system/admin/smilies/images/smilies_small.png', '" . _MD_AM_SMLS_DSC . "', '/modules/system/admin.php?fct=smilies'", "NULL, 19, '" . _MD_AM_PAGES . "', '/modules/system/admin/pages/images/pages_small.png', '" . _MD_AM_PAGES_DSC . "', '/modules/system/admin.php?fct=pages'", "NULL, 20, '" . _MD_AM_TPLSETS . "', '/modules/system/admin/tplsets/images/tplsets_small.png', '" . _MD_AM_TPLSETS_DSC . "', '/modules/system/admin.php?fct=tplsets'", "NULL, 21, '" . _MD_AM_RANK . "', '/modules/system/admin/userrank/images/userrank_small.png', '" . _MD_AM_RANK_DSC . "', '/modules/system/admin.php?fct=userrank'", "NULL, 22, '" . _MD_AM_VRSN . "', '/modules/system/admin/version/images/version_small.png', '" . _MD_AM_VRSN_DSC . "', '/modules/system/admin.php?fct=version'"); foreach ($search_items as $item) { $table->setData($item); } $table->addData(); } unset($table); } /* Optimize old tables and fix data structures */ $table = new icms_db_legacy_updater_Table('config'); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX conf_mod_cat_id, ADD INDEX mod_cat_order(conf_modid, conf_catid, conf_order)", 'Successfully altered the indexes on table config', ''); unset($table); $table = new icms_db_legacy_updater_Table('group_permission'); $table->addAlteredField('gperm_modid', "SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'", 'gperm_modid'); $table->alterTable(); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX itemid, DROP INDEX groupid, DROP INDEX gperm_modid", 'Successfully dropped the indexes on table group_permission', ''); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` ADD INDEX name_mod_group (gperm_name(10), gperm_modid, gperm_groupid)", 'Successfully added the indexes on table group_permission', ''); unset($table); $table = new icms_db_legacy_updater_Table('modules'); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX hasmain, DROP INDEX hasadmin, DROP INDEX hassearch, DROP INDEX hasnotification, DROP INDEX name, DROP INDEX dirname", 'Successfully dropped the indexes on table modules', ''); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` ADD INDEX dirname (dirname(5)), ADD INDEX active_main_weight (isactive, hasmain, weight)", 'Successfully added the indexes on table modules', ''); unset($table); $table = new icms_db_legacy_updater_Table('users'); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX email, DROP INDEX uiduname, DROP INDEX unamepass", 'Successfully dropped the indexes on table users', ''); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX login_name, ADD UNIQUE INDEX login_name (login_name)", 'Successfully added the indexes on table users', ''); unset($table); $table = new icms_db_legacy_updater_Table('priv_msgs'); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX to_userid", 'Successfully dropped the indexes on table priv_msgs', ''); unset($table); $table = new icms_db_legacy_updater_Table('ranks'); $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` DROP INDEX rank_min", 'Successfully dropped the indexes on table ranks', ''); unset($table); /* Corrects an error from db version 4 */ $table = new icms_db_legacy_updater_Table('users'); if ($table->fieldExists('pass')) { $table->addAlteredField('pass', "varchar(255) NOT NULL default ''", 'pass'); $table->alterTable(); } unset($table); /* change IP address to varchar(64) in session to accomodate IPv6 addresses */ $table = new icms_db_legacy_updater_Table('session'); if ($table->fieldExists('sess_ip')) { $table->addAlteredField('sess_ip', "varchar(64) NOT NULL default ''", 'sess_ip'); $table->alterTable(); } unset($table); /* add modname and ipf to modules table */ $table = new icms_db_legacy_updater_Table("modules"); $alter = FALSE; if (!$table->fieldExists("modname")) { $table->addNewField("modname", "varchar(25) NOT NULL default ''"); $alter = TRUE; } if (!$table->fieldExists("ipf")) { $table->addNewField("ipf", "tinyint(1) unsigned NOT NULL default '0'"); $alter = TRUE; } if ($alter) { $table->addNewFields(); } unset($table, $alter); $module_handler = icms::handler('icms_module'); $modules = $module_handler->getObjects(); foreach ($modules as $module) { if ($module->getInfo("modname") !== FALSE) { $module->setVar("modname", $module->getInfo("modname")); } if ($module->getInfo("object_items") !== FALSE) { $module->setVar("ipf", 1); } $module_handler->insert($module); } unset($module_handler, $modules); /* add slot for adsense and rename fields */ $table = new icms_db_legacy_updater_Table('system_adsense'); if (!$table->fieldExists("slot")) { $table->addNewField("slot", "varchar(12) NOT NULL default ''"); $table->addNewFields(); } if ($table->fieldExists("border_color")) { $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` CHANGE border_color color_border varchar(6) NOT NULL default ''"); } if ($table->fieldExists("background_color")) { $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` CHANGE background_color color_background varchar(6) NOT NULL default ''"); } if ($table->fieldExists("link_color")) { $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` CHANGE link_color color_link varchar(6) NOT NULL default ''"); } if ($table->fieldExists("url_color")) { $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` CHANGE url_color color_url varchar(6) NOT NULL default ''"); } if ($table->fieldExists("text_color")) { $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` CHANGE text_color color_text varchar(6) NOT NULL default ''"); } unset($table); /* rename content field for customtag */ $table = new icms_db_legacy_updater_Table("system_customtag"); if ($table->fieldExists("content")) { $icmsDatabaseUpdater->runQuery("ALTER TABLE `" . $table->name() . "` CHANGE content customtag_content text NOT NULL"); } unset($table); /* rename gperm_name from view to view_customtag for system module */ $table = new icms_db_legacy_updater_Table("group_permission"); $icmsDatabaseUpdater->runQuery("UPDATE `" . $table->name() . "` SET gperm_name = 'view_customtag' WHERE gperm_name = 'view' AND gperm_modid = 1", "", ""); unset($table); /* reset default source editor if jsvi is used */ $configs = icms::$config->getConfigs(icms_buildCriteria(array("conf_name" => "sourceeditor_default"))); if (count($configs) == 1 && $configs[0]->getVar("conf_value") == "jsvi") { $configs[0]->setVar("conf_value", "editarea"); icms::$config->insertConfig($configs[0]); } unset($configs); /* New HTML Purifier options - * purifier_HTML_FlashAllowFullScreen, after purifier_HTML_AttrNameUseCDATA * purifier_Output_FlashCompat, after purifier_HTML_FlashAllowFullScreen * purifier_Filter_AllowCustom, after purifier_Filter_YouTube * purifier_Core_NormalizeNewlines, after purifier_Core_RemoveInvalidImg */ $table = new icms_db_legacy_updater_Table("config"); // retrieve the value of the position before the config to be inserted. $configs = icms::$config->getConfigs(icms_buildCriteria(array("conf_name" => "purifier_HTML_AttrNameUseCDATA"))); $p = $configs[0]->getVar('conf_order') + 1; //move all the other options down $icmsDatabaseUpdater->runQuery("UPDATE `" . $table->name() . "` SET conf_order = conf_order + 2 WHERE conf_order >= " . $p . " AND conf_catid = " . ICMS_CONF_PURIFIER, "", ""); $icmsDatabaseUpdater->insertConfig(ICMS_CONF_PURIFIER, 'purifier_HTML_FlashAllowFullScreen', '_MD_AM_PURIFIER_HTML_FLASHFULLSCRN', '0', '_MD_AM_PURIFIER_HTML_FLASHFULLSCRNDSC', 'yesno', 'int', $p); $icmsDatabaseUpdater->insertConfig(ICMS_CONF_PURIFIER, 'purifier_Output_FlashCompat', '_MD_AM_PURIFIER_OUTPUT_FLASHCOMPAT', '0', '_MD_AM_PURIFIER_OUTPUT_FLASHCOMPATDSC', 'yesno', 'int', $p++); // retrieve the value of the position before the config to be inserted. $configs = icms::$config->getConfigs(icms_buildCriteria(array("conf_name" => "purifier_Filter_YouTube"))); $p = $configs[0]->getVar('conf_order') + 1; //move all the other options down $icmsDatabaseUpdater->runQuery("UPDATE `" . $table->name() . "` SET conf_order = conf_order + 1 WHERE conf_order >= " . $p . " AND conf_catid = " . ICMS_CONF_PURIFIER, "", ""); $icmsDatabaseUpdater->insertConfig(ICMS_CONF_PURIFIER, 'purifier_Filter_AllowCustom', '_MD_AM_PURIFIER_FILTER_ALLOWCUSTOM', '0', '_MD_AM_PURIFIER_FILTER_ALLOWCUSTOMDSC', 'yesno', 'int', $p); // retrieve the value of the position before the config to be inserted. $configs = icms::$config->getConfigs(icms_buildCriteria(array("conf_name" => "purifier_Core_RemoveInvalidImg"))); $p = $configs[0]->getVar('conf_order') + 1; //move all the other options down $icmsDatabaseUpdater->runQuery("UPDATE `" . $table->name() . "` SET conf_order = conf_order + 1 WHERE conf_order >= " . $p . " AND conf_catid = " . ICMS_CONF_PURIFIER, "", ""); $icmsDatabaseUpdater->insertConfig(ICMS_CONF_PURIFIER, 'purifier_Core_NormalizeNewlines', '_MD_AM_PURIFIER_CORE_NORMALNEWLINES', '1', '_MD_AM_PURIFIER_CORE_NORMALNEWLINESDSC', 'yesno', 'int', $p); unset($table); /* Finish up this portion of the db update */ if (!$abortUpdate) { $icmsDatabaseUpdater->updateModuleDBVersion($newDbVersion, 'system'); echo sprintf(_DATABASEUPDATER_UPDATE_OK, icms_conv_nr2local($newDbVersion)) . '<br />'; } } /* 1.3 beta|rc|final release */ /* * This portion of the upgrade must remain as the last section of code to execute * Place all release upgrade steps above this point */ echo "</code>"; if ($abortUpdate) { icms_core_Message::error(sprintf(_DATABASEUPDATER_UPDATE_ERR, icms_conv_nr2local($newDbVersion)), _DATABASEUPDATER_UPDATE_DB, TRUE); } if ($from_112 && !$abortUpdate) { /** * @todo create a language constant for this text */ echo _DATABASEUPDATER_MSG_FROM_112; echo '<script>setTimeout("window.location.href=\'' . ICMS_MODULES_URL . '/system/admin.php?fct=modulesadmin&op=install&module=content&from_112=1\'",20000);</script>'; } $feedback = ob_get_clean(); if (method_exists($module, "setMessage")) { $module->messages = $module->setMessage($feedback); } else { echo $feedback; } $icmsDatabaseUpdater->updateModuleDBVersion($newDbVersion, 'system'); return icms_core_Filesystem::cleanFolders(array('templates_c' => ICMS_COMPILE_PATH . "/", 'cache' => ICMS_CACHE_PATH . "/"), $CleanWritingFolders); }
* @copyright http://www.impresscms.org/ The ImpressCMS Project * @license LICENSE.txt * @package core * @since XOOPS * @author http://www.xoops.org The XOOPS Project * @author modified by UnderDog <*****@*****.**> * @version $Id: notification_select.php 10825 2010-12-03 00:01:23Z skenow $ */ if (!defined('ICMS_ROOT_PATH')) { exit; } include_once ICMS_ROOT_PATH . '/include/notification_constants.php'; $xoops_notification = array(); $xoops_notification['show'] = isset($icmsModule) && is_object(icms::$user) && icms_data_notification_Handler::isEnabled('inline') ? 1 : 0; if ($xoops_notification['show']) { icms_loadLanguageFile('core', 'notification'); $notification_handler = icms::handler('icms_data_notification'); $categories =& $notification_handler->subscribableCategoryInfo(); $event_count = 0; if (!empty($categories)) { foreach ($categories as $category) { $section['name'] = $category['name']; $section['title'] = $category['title']; $section['description'] = $category['description']; $section['itemid'] = $category['item_id']; $section['events'] = array(); $subscribed_events = $notification_handler->getSubscribedEvents($category['name'], $category['item_id'], $icmsModule->getVar('mid'), icms::$user->getVar('uid')); foreach ($notification_handler->categoryEvents($category['name'], true) as $event) { if (!empty($event['admin_only']) && !icms::$user->isAdmin($icmsModule->getVar('mid'))) { continue; }
/** * Displays the (good old) adminmenu * * @param int $currentoption The current option of the admin menu * @param string $breadcrumb The breadcrumb trail * @param bool $submenus Show the submenus! * @param int $currentsub The current submenu * * @return datatype description */ public function displayAdminMenu($currentoption = 0, $breadcrumb = '', $submenus = false, $currentsub = -1) { global $icmsModule, $icmsConfig; icms_loadLanguageFile($icmsModule->getVar('dirname'), 'modinfo'); icms_loadLanguageFile($icmsModule->getVar('dirname'), 'admin'); $tpl = new icms_view_Tpl(); $tpl->assign(array('headermenu' => $this->getAdminHeaderMenu(), 'adminmenu' => $this->getAdminMenu(), 'current' => $currentoption, 'breadcrumb' => $breadcrumb, 'headermenucount' => count($this->getAdminHeaderMenu()), 'submenus' => $submenus, 'currentsub' => $currentsub, 'submenuscount' => count($submenus))); $tpl->display(ICMS_ROOT_PATH . '/modules/system/templates/admin/system_adm_modulemenu.html'); }
/** * Loads common language file */ function icms_loadCommonLanguageFile() { icms_loadLanguageFile('system', 'common'); }
* (int) start * (int) imgcat_id * (int) image_id * (str) query */ $op = (isset($_GET['op'])) ? filter_input(INPUT_GET, 'op') : ((isset($_POST['op'])) ? filter_input(INPUT_POST, 'op') : 'list'); $imgcat_id = (isset($_GET['imgcat_id'])) ? (int) $_GET['imgcat_id'] : ((isset($_POST['imgcat_id'])) ? (int) $_POST['imgcat_id'] : NULL); $image_id = (isset($_GET['image_id'])) ? (int) $_GET['image_id'] : ((isset($_POST['image_id'])) ? (int) $_POST['image_id'] : NULL); $target = (isset($_GET['target'])) ? filter_input(INPUT_GET, 'target') : ((isset($_POST['target'])) ? filter_input(INPUT_POST, 'target') : NULL); $limit = (isset($_GET['limit'])) ? (int) $_GET['limit'] : ((isset($_POST['limit'])) ? (int) $_POST['limit'] : 15); $start = (isset($_GET['start'])) ? (int) $_GET['start'] : ((isset($_POST['start'])) ? (int) $_POST['start'] : 0); $type = (isset($_GET['type'])) ? filter_input(INPUT_GET, 'type') : ((isset($_POST['type'])) ? filter_input(INPUT_POST, 'type') : 'ibrow'); global $icmsConfig; // Adding language files icms_loadLanguageFile('system', 'images', TRUE); switch ($op) { case 'list': icmsPopupHeader(); echo imanager_index($imgcat_id); icmsPopupFooter(); break; case 'listimg': icmsPopupHeader(); echo imanager_listimg($imgcat_id, $start); icmsPopupFooter(); break; case 'addfile': imanager_addfile();
$mimetypeObj = $icms_mimetype_handler->get($mimetypeid); if (!$mimetypeObj->isNew()) { $sform = $mimetypeObj->getForm(_CO_ICMS_MIMETYPE_EDIT, 'addmimetype'); $sform->assign($icmsAdminTpl); $icmsAdminTpl->assign('icms_mimetype_title', _CO_ICMS_MIMETYPE_EDIT_INFO); $icmsAdminTpl->display('db:admin/mimetype/system_adm_mimetype.html'); } else { $mimetypeObj->setVar('mimetypeid', 0); $mimetypeObj->setVar('extension', ''); $sform = $mimetypeObj->getForm(_CO_ICMS_MIMETYPE_CREATE, 'addmimetype'); $sform->assign($icmsAdminTpl); $icmsAdminTpl->assign('icms_mimetype_title', _CO_ICMS_MIMETYPE_CREATE_INFO); $icmsAdminTpl->display('db:admin/mimetype/system_adm_mimetype.html'); } } icms_loadLanguageFile('system', 'common'); $icms_mimetype_handler = icms_getModuleHandler('mimetype'); if (!empty($_POST)) { foreach ($_POST as $k => $v) { ${$k} = StopXSS($v); } } if (!empty($_GET)) { foreach ($_GET as $k => $v) { ${$k} = StopXSS($v); } } $op = isset($_POST['op']) ? trim(filter_input(INPUT_POST, 'op')) : (isset($_GET['op']) ? trim(filter_input(INPUT_GET, 'op')) : ''); switch ($op) { case "mod": $mimetypeid = isset($_GET['mimetypeid']) ? (int) $_GET['mimetypeid'] : 0;