コード例 #1
0
 $optionslist = cot_config_list($o, $p, '');
 cot_die(!sizeof($optionslist), true);
 if ($o != 'core' && file_exists(cot_langfile($p, $o))) {
     require cot_langfile($p, $o);
 }
 if ($o != 'core' && file_exists(cot_incfile($p, $o))) {
     require_once cot_incfile($p, $o);
 }
 /* === Hook  === */
 foreach (cot_getextplugins('admin.config.edit.first') as $pl) {
     include $pl;
 }
 /* ===== */
 if ($a == 'update' && !empty($_POST)) {
     $updated = cot_config_update_options($p, $optionslist, $o);
     $errors = cot_get_messages('', 'error');
     if ($o == 'module' || $o == 'plug') {
         $dir = $o == 'module' ? $cfg['modules_dir'] : $cfg['plugins_dir'];
         // Run configure extension part if present
         if (file_exists($dir . "/" . $p . "/setup/" . $p . ".configure.php")) {
             include $dir . "/" . $p . "/setup/" . $p . ".configure.php";
         }
     }
     /* === Hook  === */
     foreach (cot_getextplugins('admin.config.edit.update.done') as $pl) {
         include $pl;
     }
     /* ===== */
     $cache && $cache->clear();
     if ($updated) {
         $errors ? cot_message('adm_partially_updated', 'warning') : cot_message('Updated');
コード例 #2
0
ファイル: functions.php プロジェクト: Andreyjktl/Cotonti
/**
 * Collects all messages and implodes them into a single string
 * @param string $src Origin of the target messages
 * @param string $class Group messages of selected class only. Empty to group all
 * @return string Composite HTML string
 * @see cot_error()
 * @see cot_get_messages()
 * @see cot_message()
 */
function cot_implode_messages($src = 'default', $class = '')
{
    global $R, $L, $error_string, $sys;
    $res = '';
    if (!is_array($_SESSION['cot_messages'][$sys['site_id']])) {
        return;
    }
    $messages = cot_get_messages($src, $class);
    foreach ($messages as $msg) {
        $text = isset($L[$msg['text']]) ? $L[$msg['text']] : $msg['text'];
        $res .= cot_rc('code_msg_line', array('class' => $msg['class'], 'text' => $text));
    }
    if (!empty($error_string) && (empty($class) || $class == 'error')) {
        $res .= cot_rc('code_msg_line', array('class' => 'error', 'text' => $error_string));
    }
    return empty($res) ? '' : cot_rc('code_msg_begin', array('class' => empty($class) ? 'message' : $class)) . $res . $R['code_msg_end'];
}