Beispiel #1
1
    cot_redirect($r_url);
    exit;
}
$out['subtitle'] = $L['projects_edit_project_title'];
$out['head'] .= $R['code_noindex'];
$sys['sublocation'] = $structure['projects'][$item['item_cat']]['title'];
$mskin = cot_tplfile(array('projects', 'edit', $structure['projects'][$item['item_cat']]['tpl']));
/* === Hook === */
foreach (cot_getextplugins('projects.edit.main') as $pl) {
    include $pl;
}
/* ===== */
$t = new XTemplate($mskin);
// Error and message handling
cot_display_messages($t);
$t->assign(array("PRJEDIT_FORM_SEND" => cot_url('projects', "m=edit&a=update&id=" . $item['item_id'] . "&r=" . $r), "PRJEDIT_FORM_ID" => $item['item_id'], "PRJEDIT_FORM_CAT" => cot_selectbox_structure('projects', $item['item_cat'], 'rcat'), "PRJEDIT_FORM_CATTITLE" => $structure['projects'][$item['item_cat']]['title'], "PRJEDIT_FORM_TYPETITLE" => is_array($projects_types) && !empty($item['item_type']) ? $projects_types[$item['item_type']] : '', "PRJEDIT_FORM_TYPE" => is_array($projects_types) ? cot_selectbox($item['item_type'] ? $item['item_type'] : $cfg['projects']['default_type'], 'rtype', array_keys($projects_types), array_values($projects_types)) : 'empty', "PRJEDIT_FORM_TITLE" => cot_inputbox('text', 'rtitle', $item['item_title'], 'size="56"'), "PRJEDIT_FORM_ALIAS" => cot_inputbox('text', 'ralias', $item['item_alias'], array('size' => '32', 'maxlength' => '255')), "PRJEDIT_FORM_TEXT" => cot_textarea('rtext', $item['item_text'], 10, 60, 'id="formtext"', $prjeditor ? 'input_textarea_' . $prjeditor : ''), "PRJEDIT_FORM_COST" => cot_inputbox('text', 'rcost', $item['item_cost'], 'size="10"'), "PRJEDIT_FORM_STATE" => $item['item_state'], "PRJEDIT_FORM_PARSER" => cot_selectbox($item['item_parser'], 'rparser', cot_get_parsers(), cot_get_parsers(), false), "PRJEDIT_FORM_DELETE" => cot_radiobox(0, 'rdelete', array(1, 0), array($L['Yes'], $L['No']))));
// Extra fields
foreach ($cot_extrafields[$db_projects] as $exfld) {
    $uname = strtoupper($exfld['field_name']);
    $exfld_val = cot_build_extrafields('ritem' . $exfld['field_name'], $exfld, $item['item_' . $exfld['field_name']]);
    $exfld_title = isset($L['projects_' . $exfld['field_name'] . '_title']) ? $L['projects_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
    $t->assign(array('PRJEDIT_FORM_' . $uname => $exfld_val, 'PRJEDIT_FORM_' . $uname . '_TITLE' => $exfld_title, 'PRJEDIT_FORM_EXTRAFLD' => $exfld_val, 'PRJEDIT_FORM_EXTRAFLD_TITLE' => $exfld_title));
    $t->parse('MAIN.EXTRAFLD');
}
/* === Hook === */
foreach (cot_getextplugins('projects.edit.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$module_body = $t->text('MAIN');
Beispiel #2
1
    cot_redirect($r_url);
    exit;
}
$out['subtitle'] = $L['folio_edit_product_title'];
$out['head'] .= $R['code_noindex'];
$sys['sublocation'] = $structure['folio'][$item['item_cat']]['title'];
$mskin = cot_tplfile(array('folio', 'edit', $structure['folio'][$item['item_cat']]['tpl']));
/* === Hook === */
foreach (cot_getextplugins('folio.edit.main') as $pl) {
    include $pl;
}
/* ===== */
$t = new XTemplate($mskin);
// Error and message handling
cot_display_messages($t);
$t->assign(array("PRDEDIT_FORM_SEND" => cot_url('folio', "m=edit&a=update&id=" . $item['item_id'] . "&r=" . $r), "PRDEDIT_FORM_ID" => $item['item_id'], "PRDEDIT_FORM_CAT" => cot_selectbox_structure('folio', $item['item_cat'], 'rcat'), "PRDEDIT_FORM_CATTITLE" => $structure['folio'][$item['item_cat']]['title'], "PRDEDIT_FORM_TITLE" => cot_inputbox('text', 'rtitle', $item['item_title'], 'size="56"'), "PRDEDIT_FORM_ALIAS" => cot_inputbox('text', 'ralias', $item['item_alias'], array('size' => '32', 'maxlength' => '255')), "PRDEDIT_FORM_TEXT" => cot_textarea('rtext', $item['item_text'], 10, 60, 'id="formtext"', $folioeditor ? 'input_textarea_' . $folioeditor : ''), "PRDEDIT_FORM_COST" => cot_inputbox('text', 'rcost', $item['item_cost'], 'size="10"'), "PRDEDIT_FORM_STATE" => $item['item_state'], "PRDEDIT_FORM_PARSER" => cot_selectbox($item['item_parser'], 'rparser', cot_get_parsers(), cot_get_parsers(), false), "PRDEDIT_FORM_DELETE" => cot_radiobox(0, 'rdelete', array(1, 0), array($L['Yes'], $L['No']))));
// Extra fields
foreach ($cot_extrafields[$db_folio] as $exfld) {
    $uname = strtoupper($exfld['field_name']);
    $exfld_val = cot_build_extrafields('ritem' . $exfld['field_name'], $exfld, $item['item_' . $exfld['field_name']]);
    $exfld_title = isset($L['folio_' . $exfld['field_name'] . '_title']) ? $L['folio_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
    $t->assign(array('PRDEDIT_FORM_' . $uname => $exfld_val, 'PRDEDIT_FORM_' . $uname . '_TITLE' => $exfld_title, 'PRDEDIT_FORM_EXTRAFLD' => $exfld_val, 'PRDEDIT_FORM_EXTRAFLD_TITLE' => $exfld_title));
    $t->parse('MAIN.EXTRAFLD');
}
/* === Hook === */
foreach (cot_getextplugins('folio.edit.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$module_body = $t->text('MAIN');
/**
 * Adds form for create/edit Poll
 *
 * @param int $id Poll ID or Poll Code if $type is not epmty or new for new Poll
 * @param XTemplate $t Template
 * @param string $block Poll block in Template
 * @param string $type Poll type
 * @return bool
 * @global CotDB $db
 */
function cot_poll_edit_form($id, $t = '', $block = 'MAIN', $type = '')
{
    $id = (int) $id;
    global $db, $cfg, $db_polls, $db_polls_options, $poll_id, $R, $L, $poll_options, $poll_multiple, $poll_state, $poll_text;
    if (gettype($t) != 'object') {
        $t = new XTemplate(cot_tplfile('polls'));
        $block = 'EDIT_POLL_FORM';
        $poll_full_template = true;
    }
    $counter = 0;
    $multiple = !empty($poll_multiple) ? true : false;
    if (cot_error_found() && !empty($poll_options)) {
        $id = (int) $poll_id;
        foreach ($poll_options as $key => $val) {
            if ($val != '') {
                $counter++;
                $t->assign('EDIT_POLL_OPTION_TEXT', cot_inputbox('text', 'poll_option[]', htmlspecialchars($val), 'size="40" maxlength="128"'));
                $t->parse($block . ".OPTIONS");
            }
        }
    } elseif ((int) $id > 0) {
        $where = !$type ? "poll_id = " . (int) $id : "poll_type = '" . $db->prep($type) . "' AND poll_code = '{$id}'";
        $sql = $db->query("SELECT * FROM {$db_polls} WHERE {$where} LIMIT 1");
        if ($row = $sql->fetch()) {
            $id = $row["poll_id"];
            $poll_text = htmlspecialchars($row["poll_text"]);
            $multiple = (bool) $row['poll_multiple'];
            $sql1 = $db->query("SELECT * FROM {$db_polls_options} WHERE po_pollid = {$id} ORDER by po_id ASC");
            while ($row1 = $sql1->fetch()) {
                $counter++;
                $t->assign('EDIT_POLL_OPTION_TEXT', cot_inputbox('text', 'poll_option[id' . $row1['po_id'] . ']', $row1['po_text'], 'size="40" maxlength="128"'));
                $t->parse($block . ".OPTIONS");
            }
            $sql1->closeCursor();
        }
    }
    while ($counter < 2) {
        $counter++;
        $t->assign('EDIT_POLL_OPTION_TEXT', cot_inputbox('text', 'poll_option[]', '', 'size="40" maxlength="128"'));
        $t->parse($block . ".OPTIONS");
    }
    if ($counter < $cfg['polls']['max_options_polls']) {
        $counter++;
        $t->assign('EDIT_POLL_OPTION_TEXT', cot_inputbox('text', 'poll_option[]', '', 'size="40" maxlength="128"'));
        $t->parse($block . ".OPTIONS");
    }
    if ((int) $id > 0) {
        $t->assign(array('EDIT_POLL_LOCKED' => cot_checkbox($poll_state, 'poll_state', $L['Locked']), 'EDIT_POLL_RESET' => cot_checkbox(0, 'poll_reset', $L['Reset']), 'EDIT_POLL_DELETE' => cot_checkbox(0, 'poll_delete', $L['Delete']), 'EDIT_POLL_EDIT' => true));
        $t->parse($block . ".EDIT");
    }
    $t->assign(array('EDIT_POLL_TEXT' => cot_inputbox('text', 'poll_text', $poll_text, 'size="64" maxlength="255"'), 'EDIT_POLL_IDFIELD' => cot_inputbox('hidden', 'poll_id', $id), 'EDIT_POLL_OPTIONSCOUNT' => $counter, 'EDIT_POLL_ID' => $id, 'EDIT_POLL_MULTIPLE' => cot_checkbox($multiple, 'poll_multiple', $L['polls_multiple'])));
    if ($poll_full_template == true) {
        $t->parse($block);
        return $t->text($block);
    }
    return true;
}
function cfg_password($cfg_var, $minlength = 4)
{
    if (!$minlength) {
        $minlength = 4;
    }
    $value = $cfg_var['config_value'];
    $var_name = $cfg_var['config_name'];
    $type = 'password';
    $attr = array('pattern' => '[^\\s]{' . $minlength . ',}');
    $input_code = cot_inputbox($type, $var_name . '[0]', $value, $attr) . ' <br>Repeat password to change it:<br>' . cot_inputbox($type, $var_name . '[1]', '', $attr);
    return $input_code;
}
function form_structure_editor($id)
{
    global $cot_structure, $cot_extrafields, $db_structure, $structure, $L, $R;
    $row = $cot_structure->category($id);
    if (empty($row)) {
        return null;
    }
    $ii++;
    $structure_id = $row['structure_id'];
    $structure_code = $row['structure_code'];
    $n = $row['structure_area'];
    $dozvil = $row['structure_count'] > 0 ? false : true;
    $is_module = cot_module_active($n);
    $t = new XTemplate(cot_tplfile('cateditor.admin.edit', 'plug'));
    $t->assign(array('ADMIN_STRUCTURE_HEADER' => $row['structure_title'], 'ADMIN_STRUCTURE_DEL_URL' => $dozvil ? cot_confirm_url(cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&a=delete&id=' . $row['structure_id'] . '&' . cot_xg()), 'admin') : '', 'ADMIN_STRUCTURE_UPDATE_FORM_URL' => cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&id=' . $structure_id . '&a=update'), 'ADMIN_STRUCTURE_ID' => $row['structure_id'], 'ADMIN_STRUCTURE_CODE' => cot_inputbox('text', 'rstructurecode', $structure_code, 'size="10" maxlength="255"'), 'ADMIN_STRUCTURE_PATHFIELDIMG' => mb_strpos($row['structure_path'], '.') == 0 ? $R['admin_icon_join1'] : $R['admin_icon_join2'], 'ADMIN_STRUCTURE_PATH' => cot_inputbox('text', 'rstructurepath', $row['structure_path'], 'size="12" maxlength="255"'), 'ADMIN_STRUCTURE_TPL' => cot_inputbox('text', 'rstructuretpl', $row['structure_tpl'], 'size="10" maxlength="255"'), 'ADMIN_STRUCTURE_TITLE' => cot_inputbox('text', 'rstructuretitle', $row['structure_title'], 'size="32" maxlength="255"'), 'ADMIN_STRUCTURE_DESC' => cot_inputbox('text', 'rstructuredesc', $row['structure_desc'], 'size="64" maxlength="255"'), 'ADMIN_STRUCTURE_ICON' => cot_inputbox('text', 'rstructureicon', $row['structure_icon'], 'size="64" maxlength="128"'), 'ADMIN_STRUCTURE_LOCKED' => cot_checkbox($row['structure_locked'], 'rstructurelocked'), 'ADMIN_STRUCTURE_COUNT' => $row['structure_count'], 'ADMIN_STRUCTURE_PARENT' => $cot_structure->select($cot_structure->get_parent($id), 'rstructureparent', true, 'disabled="disabled"'), 'ADMIN_STRUCTURE_JUMPTO_URL' => cot_url($n, 'c=' . $structure_code), 'ADMIN_STRUCTURE_RIGHTS_URL' => $is_module ? cot_url('admin', 'm=rightsbyitem&ic=' . $n . '&io=' . $structure_code) : '', 'ADMIN_STRUCTURE_ODDEVEN' => cot_build_oddeven($ii)));
    foreach ($cot_extrafields[$db_structure] as $exfld) {
        $exfld_val = cot_build_extrafields('rstructure' . $exfld['field_name'], $exfld, $row['structure_' . $exfld['field_name']]);
        $exfld_title = isset($L['structure_' . $exfld['field_name'] . '_title']) ? $L['structure_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
        $t->assign(array('ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) => $exfld_val, 'ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) . '_TITLE' => $exfld_title, 'ADMIN_STRUCTURE_EXTRAFLD' => $exfld_val, 'ADMIN_STRUCTURE_EXTRAFLD_TITLE' => $exfld_title));
        $t->parse('MAIN.EXTRAFLD');
    }
    require_once cot_incfile('configuration');
    $optionslist = cot_config_list($is_module ? 'module' : 'plug', $n, $structure_code);
    /* === Hook - Part1 : Set === */
    $extp = cot_getextplugins('admin.config.edit.loop');
    /* ===== */
    foreach ($optionslist as $row_c) {
        list($title, $hint) = cot_config_titles($row_c['config_name'], $row_c['config_text']);
        if ($row_c['config_type'] == COT_CONFIG_TYPE_SEPARATOR) {
            $t->assign('ADMIN_CONFIG_FIELDSET_TITLE', $title);
            $t->parse('MAIN.OPTIONS.CONFIG.ADMIN_CONFIG_ROW.ADMIN_CONFIG_FIELDSET_BEGIN');
        } else {
            $t->assign(array('ADMIN_CONFIG_ROW_CONFIG' => cot_config_input($row_c['config_name'], $row_c['config_type'], $row_c['config_value'], $row_c['config_variants']), 'ADMIN_CONFIG_ROW_CONFIG_TITLE' => $title, 'ADMIN_CONFIG_ROW_CONFIG_MORE_URL' => cot_url('admin', 'm=structure&n=' . $n . '&d=' . $durl . '&id=' . $structure_id . '&al=' . $structure_code . '&a=reset&v=' . $row_c['config_name'] . '&' . cot_xg()), 'ADMIN_CONFIG_ROW_CONFIG_MORE' => $hint));
            /* === Hook - Part2 : Include === */
            foreach ($extp as $pl) {
                include $pl;
            }
            /* ===== */
            $t->parse('MAIN.CONFIG.ADMIN_CONFIG_ROW.ADMIN_CONFIG_ROW_OPTION');
        }
        $t->parse('MAIN.CONFIG.ADMIN_CONFIG_ROW');
    }
    /* === Hook  === */
    foreach (cot_getextplugins('admin.config.edit.tags') as $pl) {
        include $pl;
    }
    /* ===== */
    $t->assign('CONFIG_HIDDEN', cot_inputbox('hidden', 'editconfig', $structure_code));
    $t->parse('MAIN.CONFIG');
    $t->parse('MAIN');
    return $t->text('MAIN');
}
function form_structure_new($parentid = '')
{
    global $cot_structure, $cot_extrafields, $db_structure, $structure, $L, $R;
    $t = new XTemplate(cot_tplfile('cateditor.admin.new', 'plug'));
    $t->assign(array('ADMIN_STRUCTURE_URL_FORM_ADD' => cot_url('admin', 'm=other&p=cateditor&n=' . $n . '&a=add'), 'ADMIN_STRUCTURE_CODE' => cot_inputbox('text', 'rstructurecode', null, 'size="16"'), 'ADMIN_STRUCTURE_PARENT' => $cot_structure->select($parentid, 'rstructureparent'), 'ADMIN_STRUCTURE_TITLE' => cot_inputbox('text', 'rstructuretitle', null, 'size="64" maxlength="100"'), 'ADMIN_STRUCTURE_DESC' => cot_inputbox('text', 'rstructuredesc', null, 'size="64" maxlength="255"'), 'ADMIN_STRUCTURE_ICON' => cot_inputbox('text', 'rstructureicon', null, 'size="64" maxlength="128"'), 'ADMIN_STRUCTURE_LOCKED' => cot_checkbox(null, 'rstructurelocked'), 'ADMIN_STRUCTURE_TPL' => cot_inputbox('text', 'rstructuretpl', null, 'size="10" maxlength="255"')));
    // Extra fields
    foreach ($cot_extrafields[$db_structure] as $exfld) {
        $exfld_val = cot_build_extrafields('rstructure' . $exfld['field_name'], $exfld, null);
        $exfld_title = isset($L['structure_' . $exfld['field_name'] . '_title']) ? $L['structure_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
        $t->assign(array('ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) => $exfld_val, 'ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) . '_TITLE' => $exfld_title, 'ADMIN_STRUCTURE_EXTRAFLD' => $exfld_val, 'ADMIN_STRUCTURE_EXTRAFLD_TITLE' => $exfld_title));
        $t->parse('MAIN.EXTRAFLD');
    }
    $t->parse('MAIN');
    return $t->text('MAIN');
}
function cot_install_step2_tags()
{
    global $t, $db_name;
    $db_x = "flance_";
    $t->assign(array('INSTALL_DB_X' => $db_x, 'INSTALL_DB_X_INPUT' => cot_inputbox('text', 'db_x', $db_x, 'size="32"'), 'INSTALL_DB_NAME_INPUT' => cot_inputbox('text', 'db_name', is_null($db_name) ? 'freelance' : $db_name, 'size="32"')));
}
        $rinput['type_title'] = cot_import($rtitle, 'D', 'TXT');
        if (!empty($rinput['type_title'])) {
            $db->update($db_projects_types, $rinput, "type_id=" . (int) $rid);
        } else {
            $db->delete($db_projects_types, "type_id=" . (int) $rid);
        }
    }
    if (!empty($rdefault)) {
        $db->update($db_config, array('config_value' => $rdefault), "config_name = ? \n\t\t\tAND config_cat = ?", array('default_type', 'projects'));
    }
    $cache && $cache->clear();
    cot_redirect(cot_url('admin', 'm=projects&p=types&d=' . $d_url, '#footer', true));
    exit;
}
$totalitems = $db->query("SELECT COUNT(*) FROM {$db_projects_types}")->fetchColumn();
$sql = $db->query("SELECT * FROM {$db_projects_types} ORDER by type_title ASC LIMIT {$d}, " . $cfg['maxrowsperpage']);
$pagenav = cot_pagenav('admin', 'm=projects&p=types', $d, $totalitems, $cfg['maxrowsperpage']);
$t = new XTemplate(cot_tplfile('projects.admin.types', 'module'));
$jj = 0;
while ($item = $sql->fetch()) {
    $jj++;
    $t->assign(array('TYPE_ROW_ID' => cot_inputbox('text', 'rtitle[' . $item['type_id'] . ']', $item['type_title']), 'TYPE_ROW_TITLE' => cot_inputbox('text', 'rtitle[' . $item['type_id'] . ']', $item['type_title']), 'TYPE_ROW_DEFAULT' => cot_radiobox($cfg['projects']['default_type'], 'rdefault', $item['type_id']), 'TYPE_ROW_DEL_URL' => cot_url('admin', 'm=projects&p=types&id=' . $item['type_id'] . '&a=delete'), 'TYPE_ROW_NUM' => $jj, 'TYPE_ROW_ODDEVEN' => cot_build_oddeven($jj)));
    $t->parse("MAIN.ROWS");
}
if ($jj == 0) {
    $t->parse("MAIN.NOROWS");
}
$t->assign(array("EDITFORM_ACTION_URL" => cot_url('admin', 'm=projects&p=types&a=edit&d=' . $d_url), "ADDFORM_ACTION_URL" => cot_url('admin', 'm=projects&p=types&a=add'), "PAGENAV_PAGES" => $pagenav['main'], "PAGENAV_PREV" => $pagenav['prev'], "PAGENAV_NEXT" => $pagenav['next'], "ADDFORM_TITLE" => cot_inputbox('text', 'rtitle', ''), "ADDFORM_DEFAULT" => cot_inputbox('checkbox', 'rdefault', 1)));
$t->parse("MAIN.ADDFORM");
$t->parse("MAIN");
$adminmain = $t->text("MAIN");
Beispiel #9
0
     $status['mysql'] = extension_loaded('pdo_mysql') ? $R['install_code_available'] : $R['install_code_not_available'];
     $t->assign(array('INSTALL_AV_DIR' => $status['avatars_dir'], 'INSTALL_CACHE_DIR' => $status['cache_dir'], 'INSTALL_PFS_DIR' => $status['pfs_dir'], 'INSTALL_EXFLDS_DIR' => $status['exflds_dir'], 'INSTALL_PHOTOS_DIR' => $status['photos_dir'], 'INSTALL_THUMBS_DIR' => $status['thumbs_dir'], 'INSTALL_CONFIG' => $status['config'], 'INSTALL_CONFIG_SAMPLE' => $status['config_sample'], 'INSTALL_SQL_FILE' => $status['sql_file'], 'INSTALL_PHP_VER' => $status['php_ver'], 'INSTALL_MBSTRING' => $status['mbstring'], 'INSTALL_HASH' => $status['hash'], 'INSTALL_MYSQL' => $status['mysql']));
     break;
 case 2:
     // Database form
     $t->assign(array('INSTALL_DB_HOST' => is_null($db_host) ? $cfg['mysqlhost'] : $db_host, 'INSTALL_DB_PORT' => is_null($db_port) ? $cfg['mysqlport'] : $db_port, 'INSTALL_DB_USER' => is_null($db_user) ? $cfg['mysqluser'] : $db_user, 'INSTALL_DB_NAME' => is_null($db_name) ? $cfg['mysqldb'] : $db_name, 'INSTALL_DB_X' => $db_x, 'INSTALL_DB_HOST_INPUT' => cot_inputbox('text', 'db_host', is_null($db_host) ? $cfg['mysqlhost'] : $db_host, 'size="32"'), 'INSTALL_DB_PORT_INPUT' => cot_inputbox('text', 'db_port', is_null($db_port) ? $cfg['mysqlport'] : $db_port, 'size="32"'), 'INSTALL_DB_USER_INPUT' => cot_inputbox('text', 'db_user', is_null($db_user) ? $cfg['mysqluser'] : $db_user, 'size="32"'), 'INSTALL_DB_NAME_INPUT' => cot_inputbox('text', 'db_name', is_null($db_name) ? $cfg['mysqldb'] : $db_name, 'size="32"'), 'INSTALL_DB_PASS_INPUT' => cot_inputbox('password', 'db_pass', '', 'size="32"'), 'INSTALL_DB_X_INPUT' => cot_inputbox('text', 'db_x', $db_x, 'size="32"')));
     break;
 case 3:
     // Settings
     if ($_POST['step'] != 3 && !cot_check_messages()) {
         $rtheme = $theme;
         $rscheme = $scheme;
         $rlang = $cfg['defaultlang'];
         $cfg['mainurl'] = $site_url;
     }
     $t->assign(array('INSTALL_THEME_SELECT' => cot_selectbox_theme($rtheme, $rscheme, 'theme'), 'INSTALL_LANG_SELECT' => cot_selectbox_lang($rlang, 'lang'), 'INSTALL_COUNTRY_SELECT' => cot_selectbox_countries($user['country'], 'user_country'), 'INSTALL_MAINURL' => cot_inputbox('text', 'mainurl', $cfg['mainurl'], 'size="32"'), 'INSTALL_USERNAME' => cot_inputbox('text', 'user_name', $user['name'], 'size="32"'), 'INSTALL_PASS1' => cot_inputbox('password', 'user_pass', '', 'size="32"'), 'INSTALL_PASS2' => cot_inputbox('password', 'user_pass2', '', 'size="32"'), 'INSTALL_EMAIL' => cot_inputbox('text', 'user_email', $user['email'], 'size="32"')));
 case 4:
     // Extensions
     cot_install_parse_extensions('Module', $default_modules, $selected_modules);
     cot_install_parse_extensions('Plugin', $default_plugins, $selected_plugins);
     // robots.txt
     $robotsTxtFilePath = './robots.txt';
     if (file_exists($robotsTxtFilePath) && is_writable($robotsTxtFilePath)) {
         $robotsTxtFile = file_get_contents($robotsTxtFilePath);
         $tmp = 'Host: ' . str_replace(array('http://', 'https://'), '', $cfg['mainurl']);
         $robotsTxtFile = str_replace('# Host: http://your-domain.com', $tmp, $robotsTxtFile);
         file_put_contents($robotsTxtFilePath, $robotsTxtFile);
     }
     break;
 case 5:
     // End credits
foreach (cot_getextplugins('market.list.query') as $pl) {
    include $pl;
}
/* ===== */
$t = new XTemplate($mskin);
$where = $where ? 'WHERE ' . implode(' AND ', $where) : '';
$order = $order ? 'ORDER BY ' . implode(', ', $order) : '';
$totalitems = $db->query("SELECT COUNT(*) FROM {$db_market} AS m {$join_condition} \n\tLEFT JOIN {$db_users} AS u ON u.user_id=m.item_userid\n\t" . $where . "")->fetchColumn();
$sqllist = $db->query("SELECT m.*, u.* {$join_columns} \n\tFROM {$db_market} AS m {$join_condition}\n\tLEFT JOIN {$db_users} AS u ON u.user_id=m.item_userid \n\t" . $where . "\n\t" . $order . "\n\tLIMIT {$d}, " . $maxrowsperpage);
$pagenav = cot_pagenav('market', $list_url_path, $d, $totalitems, $maxrowsperpage);
$catpatharray[] = array(cot_url('market'), $L['market']);
if (!empty($c)) {
    $catpatharray = array_merge($catpatharray, cot_structure_buildpath('market', $c));
}
$catpath = cot_breadcrumbs($catpatharray, $cfg['homebreadcrumb'], true);
$t->assign(array("SEARCH_ACTION_URL" => cot_url('market', '', '', true), "SEARCH_SQ" => cot_inputbox('text', 'sq', htmlspecialchars($sq), 'class="schstring"'), "SEARCH_CAT" => cot_market_selectcat($c, 'c'), "SEARCH_SORTER" => cot_selectbox($sort, "sort", array('', 'costasc', 'costdesc'), array($L['market_mostrelevant'], $L['market_costasc'], $L['market_costdesc']), false), "PAGENAV_PAGES" => $pagenav['main'], "PAGENAV_PREV" => $pagenav['prev'], "PAGENAV_NEXT" => $pagenav['next'], "PAGENAV_COUNT" => $totalitems, "CATALOG" => cot_build_structure_market_tree('', array($c), 0), "BREADCRUMBS" => $catpath, "CATTITLE" => !empty($c) ? $structure['market'][$c]['title'] : '', "CATDESC" => !empty($c) ? $structure['market'][$c]['desc'] : ''));
foreach ($cot_extrafields[$db_market] as $exfld) {
    $uname = strtoupper($exfld['field_name']);
    $exfld_val = cot_build_extrafields($exfld['field_name'], $exfld, $shfld[$exfld['field_name']]);
    $exfld_title = isset($L['projects_' . $exfld['field_name'] . '_title']) ? $L['projects_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
    $t->assign(array('SEARCH_' . $uname => $exfld_val, 'SEARCH_' . $uname . '_TITLE' => $exfld_title));
}
/* === Hook === */
foreach (cot_getextplugins('market.list.search.tags') as $pl) {
    include $pl;
}
/* ===== */
$sqllist_rowset = $sqllist->fetchAll();
$sqllist_idset = array();
foreach ($sqllist_rowset as $item) {
    $sqllist_idset[$item['item_id']] = $item['item_alias'];
Beispiel #11
0
/**
 * Generates comments display for a given item
 *
 * @param string $ext_name Module or plugin code
 * @param string $code Item identifier
 * @param string $cat Item category code (optional)
 * @param bool $force_admin Enforces user to be administrator of comments for this item.
 *	E.g. to moderate his wall even if he is not a moderator
 * @return string Rendered HTML output for comments
 * @global CotDB $db
 */
function cot_comments_display($ext_name, $code, $cat = '', $force_admin = false)
{
    global $db, $db_com, $db_users, $cfg, $usr, $L, $sys, $R, $env, $pg, $cot_extrafields, $cache, $structure;
    // Check permissions and enablement
    list($auth_read, $auth_write, $auth_admin) = cot_auth('plug', 'comments');
    if ($auth_read && $auth_write && $force_admin) {
        $auth_admin = true;
        $_SESSION['cot_comments_force_admin'][$ext_name][$code] = true;
    }
    $enabled = cot_comments_enabled($ext_name, $cat, $code);
    if (!$auth_read || !$enabled && !$auth_admin) {
        return '';
    }
    $comments_join_columns = $comments_join_tables = $comments_join_where = '';
    // Get the URL and parameters
    $link_area = $env['ext'];
    $link_params = $_GET;
    if (defined('COT_PLUG')) {
        $link_area = 'plug';
        $link_params['e'] = $env['ext'];
    }
    if (isset($_GET['rwr'])) {
        unset($link_params['rwr'], $link_params['e']);
    }
    $cot_com_back = array($link_area, $link_params);
    $_SESSION['cot_com_back'][$ext_name][$cat][$code] = $cot_com_back;
    $d_var = 'dcm';
    list($pg, $d, $durl) = cot_import_pagenav($d_var, $cfg['plugin']['comments']['maxcommentsperpage']);
    $d = empty($d) ? 0 : (int) $d;
    if ($auth_write && $enabled) {
        require_once cot_incfile('forms');
    }
    $t = new XTemplate(cot_tplfile('comments', 'plug'));
    /* == Hook == */
    foreach (cot_getextplugins('comments.main') as $pl) {
        include $pl;
    }
    /* ===== */
    $editor = cot::$cfg['plugin']['comments']['markup'] ? 'input_textarea_minieditor' : '';
    $t->assign(array('COMMENTS_CODE' => $code, 'COMMENTS_FORM_SEND' => cot_url('plug', "e=comments&a=send&area={$ext_name}&cat={$cat}&item={$code}"), 'COMMENTS_FORM_AUTHOR' => $usr['id'] > 0 ? $usr['name'] : cot_inputbox('text', 'rname'), 'COMMENTS_FORM_AUTHORID' => $usr['id'], 'COMMENTS_FORM_TEXT' => $auth_write && $enabled ? cot_textarea('rtext', $rtext, 7, 120, '', $editor) . cot_inputbox('hidden', 'cb', base64_encode(serialize($cot_com_back))) : '', 'COMMENTS_DISPLAY' => $cfg['plugin']['comments']['expand_comments'] ? '' : 'none'));
    if ($auth_write && $enabled) {
        // Extra fields
        if (!empty(cot::$extrafields[cot::$db->com])) {
            foreach (cot::$extrafields[cot::$db->com] as $exfld) {
                $uname = strtoupper($exfld['field_name']);
                $exfld_val = cot_build_extrafields('rcomments' . $exfld['field_name'], $exfld, $rcomments[$exfld['field_name']]);
                $exfld_title = cot_extrafield_title($exfld, 'comments_');
                $t->assign(array('COMMENTS_FORM_' . $uname => $exfld_val, 'COMMENTS_FORM_' . $uname . '_TITLE' => $exfld_title, 'COMMENTS_FORM_EXTRAFLD' => $exfld_val, 'COMMENTS_FORM_EXTRAFLD_TITLE' => $exfld_title));
                $t->parse('COMMENTS.COMMENTS_NEWCOMMENT.EXTRAFLD');
            }
        }
        $allowed_time = cot_build_timegap($sys['now'] - $cfg['plugin']['comments']['time'] * 60, $sys['now']);
        $com_hint = cot_rc('com_edithint', array('time' => $allowed_time));
        /* == Hook == */
        foreach (cot_getextplugins('comments.newcomment.tags') as $pl) {
            include $pl;
        }
        /* ===== */
        $usr['id'] == 0 && $t->parse('COMMENTS.COMMENTS_NEWCOMMENT.GUEST');
        if ($usr['id'] == 0 && cot_check_messages() && $cache) {
            if ($ext_name == 'page' && $cfg['cache_page']) {
                $cache->page->clear('page/' . str_replace('.', '/', $structure['page'][$cat]['path']));
                $cfg['cache_page'] = false;
            }
        }
        cot_display_messages($t, 'COMMENTS.COMMENTS_NEWCOMMENT');
        $t->assign('COMMENTS_FORM_HINT', $com_hint);
        $t->parse('COMMENTS.COMMENTS_NEWCOMMENT');
    } else {
        $warning = $enabled ? $L['com_regonly'] : $L['com_closed'];
        $t->assign('COMMENTS_CLOSED', $warning);
        $t->parse('COMMENTS.COMMENTS_CLOSED');
    }
    $order = $cfg['plugin']['comments']['order'] == 'Chronological' ? 'ASC' : 'DESC';
    $comments_order = "com_id {$order}";
    /* == Hook == */
    foreach (cot_getextplugins('comments.query') as $pl) {
        include $pl;
    }
    /* ===== */
    $sql = $db->query("SELECT c.*, u.* {$comments_join_columns}\n\t\tFROM {$db_com} AS c LEFT JOIN {$db_users} AS u ON u.user_id = c.com_authorid {$comments_join_tables}\n\t\tWHERE com_area = ? AND com_code = ? {$comments_join_where} ORDER BY {$comments_order} LIMIT ?, ?", array($ext_name, $code, (int) $d, (int) $cfg['plugin']['comments']['maxcommentsperpage']));
    if ($sql->rowCount() > 0 && $enabled) {
        $i = $d;
        $kk = 0;
        $totalitems = cot_comments_count($ext_name, $code);
        /* === Hook - Part1 : Set === */
        $extp = cot_getextplugins('comments.loop');
        /* ===== */
        foreach ($sql->fetchAll() as $row) {
            $i++;
            $kk++;
            $com_admin = $auth_admin ? cot_rc('comments_code_admin', array('ipsearch' => cot_build_ipsearch($row['com_authorip']), 'delete_url' => cot_confirm_url(cot_url('plug', 'e=comments&a=delete&cat=' . $cat . '&id=' . $row['com_id'] . '&' . cot_xg()), 'comments', 'comments_confirm_delete'))) : '';
            $com_text = cot_parse($row['com_text'], $cfg['plugin']['comments']['markup']);
            $time_limit = $sys['now'] < $row['com_date'] + $cfg['plugin']['comments']['time'] * 60 ? TRUE : FALSE;
            $usr['isowner_com'] = $time_limit && ($usr['id'] > 0 && $row['com_authorid'] == $usr['id'] || $usr['id'] == 0 && !empty($_SESSION['cot_comments_edit'][$row['com_id']]) && $usr['ip'] == $row['com_authorip']);
            $com_gup = $sys['now'] - ($row['com_date'] + $cfg['plugin']['comments']['time'] * 60);
            $allowed_time = $usr['isowner_com'] && !$usr['isadmin'] ? ' - ' . cot_build_timegap($sys['now'] + $com_gup, $sys['now']) . $L['plu_comgup'] : '';
            $com_edit = $auth_admin || $usr['isowner_com'] ? cot_rc('comments_code_edit', array('edit_url' => cot_url('plug', 'e=comments&m=edit&cat=' . $cat . '&id=' . $row['com_id']), 'allowed_time' => $allowed_time)) : '';
            if ($row['com_area'] == 'page') {
                if ($usr['id'] == 0 && $usr['isowner_com'] && $cfg['cache_page']) {
                    $cfg['cache_page'] = $cfg['cache_index'] = false;
                }
            }
            $t->assign(array('COMMENTS_ROW_ID' => $row['com_id'], 'COMMENTS_ROW_ORDER' => $cfg['plugin']['comments']['order'] == 'Recent' ? $totalitems - $i + 1 : $i, 'COMMENTS_ROW_URL' => cot_url($link_area, $link_params, '#c' . $row['com_id']), 'COMMENTS_ROW_AUTHOR' => cot_build_user($row['com_authorid'], htmlspecialchars($row['com_author'])), 'COMMENTS_ROW_AUTHORID' => $row['com_authorid'], 'COMMENTS_ROW_TEXT' => $com_text, 'COMMENTS_ROW_DATE' => cot_date('datetime_medium', $row['com_date']), 'COMMENTS_ROW_DATE_STAMP' => $row['com_date'], 'COMMENTS_ROW_ADMIN' => $com_admin, 'COMMENTS_ROW_EDIT' => $com_edit, 'COMMENTS_ROW_ODDEVEN' => cot_build_oddeven($kk), 'COMMENTS_ROW_NUM' => $kk));
            // Extrafields
            if (!empty(cot::$extrafields[cot::$db->com])) {
                foreach (cot::$extrafields[cot::$db->com] as $exfld) {
                    $tag = mb_strtoupper($exfld['field_name']);
                    $exfld_title = cot_extrafield_title($exfld, 'comments_');
                    $t->assign(array('COMMENTS_ROW_' . $tag . '_TITLE' => $exfld_title, 'COMMENTS_ROW_' . $tag => cot_build_extrafields_data('comments', $exfld, $row['com_' . $exfld['field_name']]), 'COMMENTS_ROW_' . $tag . '_VALUE' => $row['com_' . $exfld['field_name']]));
                }
            }
            $t->assign(cot_generate_usertags($row, 'COMMENTS_ROW_AUTHOR_', htmlspecialchars($row['com_author'])));
            /* === Hook - Part2 : Include === */
            foreach ($extp as $pl) {
                include $pl;
            }
            /* ===== */
            $t->parse('COMMENTS.COMMENTS_ROW');
        }
        $pagenav = cot_pagenav($link_area, $link_params, $d, $totalitems, $cfg['plugin']['comments']['maxcommentsperpage'], $d_var, '#comments', $cfg['jquery'] && $cfg['ajax_enabled'], 'comments', 'plug', "e=comments&area={$ext_name}&cat={$cat}&item={$code}");
        $t->assign(array('COMMENTS_PAGES_INFO' => cot_rc('comments_code_pages_info', array('totalitems' => $totalitems, 'onpage' => $i - $d)), 'COMMENTS_PAGES_TOTALITEMS' => $totalitems, 'COMMENTS_PAGES_PAGESPREV' => $pagenav['prev'], 'COMMENTS_PAGES_PAGNAV' => $pagenav['main'], 'COMMENTS_PAGES_PAGESNEXT' => $pagenav['next']));
        $t->parse('COMMENTS.PAGNAVIGATOR');
    } elseif (!$sql->rowCount() && $enabled) {
        $t->assign(array('COMMENTS_EMPTYTEXT' => $L['com_nocommentsyet']));
        $t->parse('COMMENTS.COMMENTS_EMPTY');
    }
    /* == Hook == */
    foreach (cot_getextplugins('comments.tags') as $pl) {
        include $pl;
    }
    /* ===== */
    $t->parse('COMMENTS');
    $res_display = $t->text('COMMENTS');
    return $res_display;
}
Beispiel #12
0
        cot_log("Wrong validation URL", 'sec');
        cot_redirect(cot_url('message', 'msg=157', '', true));
    }
}
$mskin = cot_tplfile('users.register', 'module');
/* === Hook === */
foreach (cot_getextplugins('users.register.main') as $pl) {
    include $pl;
}
/* ===== */
$out['subtitle'] = $L['aut_registertitle'];
$out['head'] .= $R['code_noindex'];
require_once $cfg['system_dir'] . '/header.php';
$t = new XTemplate($mskin);
require_once cot_incfile('forms');
$t->assign(array('USERS_REGISTER_TITLE' => $L['aut_registertitle'], 'USERS_REGISTER_SUBTITLE' => $L['aut_registersubtitle'], 'USERS_REGISTER_ADMINEMAIL' => $cot_adminemail, 'USERS_REGISTER_SEND' => cot_url('users', 'm=register&a=add'), 'USERS_REGISTER_USER' => cot_inputbox('text', 'rusername', $ruser['user_name'], array('size' => 24, 'maxlength' => 100)), 'USERS_REGISTER_EMAIL' => cot_inputbox('text', 'ruseremail', $ruser['user_email'], array('size' => 24, 'maxlength' => 64)), 'USERS_REGISTER_PASSWORD' => cot_inputbox('password', 'rpassword1', '', array('size' => 12, 'maxlength' => 32)), 'USERS_REGISTER_PASSWORDREPEAT' => cot_inputbox('password', 'rpassword2', '', array('size' => 12, 'maxlength' => 32)), 'USERS_REGISTER_COUNTRY' => cot_selectbox_countries($ruser['user_country'], 'rcountry'), 'USERS_REGISTER_TIMEZONE' => cot_selectbox_timezone($ruser['user_timezone'], 'rusertimezone'), 'USERS_REGISTER_GENDER' => cot_selectbox_gender($ruser['user_gender'], 'rusergender'), 'USERS_REGISTER_BIRTHDATE' => cot_selectbox_date(0, 'short', 'ruserbirthdate', cot_date('Y', $sys['now']), cot_date('Y', $sys['now']) - 100, false)));
// Extra fields
if (!empty(cot::$extrafields[cot::$db->users])) {
    foreach (cot::$extrafields[cot::$db->users] as $exfld) {
        $uname = strtoupper($exfld['field_name']);
        $exfld_val = cot_build_extrafields('ruser' . $exfld['field_name'], $exfld, $ruser['user_' . $exfld['field_name']]);
        $exfld_title = cot_extrafield_title($exfld, 'user_');
        $t->assign(array('USERS_REGISTER_' . $uname => $exfld_val, 'USERS_REGISTER_' . $uname . '_TITLE' => $exfld_title, 'USERS_REGISTER_EXTRAFLD' => $exfld_val, 'USERS_REGISTER_EXTRAFLD_TITLE' => $exfld_title));
        $t->parse('MAIN.EXTRAFLD');
    }
}
/* === Hook === */
foreach (cot_getextplugins('users.register.tags') as $pl) {
    include $pl;
}
/* ===== */
Beispiel #13
0
    $t->assign(array('POST_FORM_ACTION' => cot_url('sbr', 'id=' . $id . '&num=' . $num . '&a=addpost'), 'POST_FORM_TO' => cot_selectbox($to, 'to', $R['sbr_posts_to_values'], $R['sbr_posts_to_titles'])));
    cot_display_messages($t, 'MAIN.SBR.POSTS.POSTFORM');
    $t->parse('MAIN.SBR.POSTS.POSTFORM');
    $t->parse('MAIN.SBR.POSTS');
    /* === Hook === */
    foreach (cot_getextplugins('sbr.tags') as $pl) {
        include $pl;
    }
    /* ===== */
    $t->parse('MAIN.SBR');
}
if ($action == 'done') {
    // Действие доступно только для заказчика
    cot_block($role == 'employer');
    $t->assign(array('STAGEDONE_FORM_ACTION' => cot_url('sbr', 'id=' . $id . '&num=' . $num . '&a=done'), 'STAGEDONE_FORM_TEXT' => cot_textarea('rtext', $rtext, 5, 80)));
    cot_display_messages($t, 'MAIN.STAGEDONE');
    $t->parse('MAIN.STAGEDONE');
}
if ($action == 'claim') {
    $stage = $db->query("SELECT * FROM {$db_sbr_stages} WHERE stage_sid=" . $id . " AND stage_num=" . $num)->fetch();
    cot_block(!empty($role) && $sbr['sbr_status'] == 'process' && $stage['stage_status'] == 'process');
    $t->assign(array('CLAIM_FORM_ACTION' => cot_url('sbr', 'id=' . $id . '&num=' . $num . '&a=claim'), 'CLAIM_FORM_TEXT' => cot_textarea('rtext', $rtext, 5, 80)));
    cot_display_messages($t, 'MAIN.CLAIM');
    $t->parse('MAIN.CLAIM');
}
if ($action == 'decision') {
    cot_block($usr['isadmin'] && $sbr['sbr_status'] == 'claim');
    $t->assign(array('DECISION_FORM_ACTION' => cot_url('sbr', 'id=' . $id . '&num=' . $num . '&a=decision'), 'DECISION_FORM_TEXT' => cot_textarea('rdecisiontext', $rtext, 5, 80), 'DECISION_FORM_PAYPERFORMER' => cot_inputbox('text', 'payperformer', $payperformer), 'DECISION_FORM_PAYEMPLOYER' => cot_inputbox('text', 'payemployer', $payemployer)));
    cot_display_messages($t, 'MAIN.DECISION');
    $t->parse('MAIN.DECISION');
}
Beispiel #14
0
    }
    if (!cot_error_found()) {
        $t->parse('MAIN.RESULTS');
    }
    $rs_url_path = array();
    foreach ($rs as $k => $v) {
        if (is_array($v)) {
            foreach ($v as $sk => $sv) {
                $rs_url_path['rs[' . $k . '][' . $sk . ']'] = $sv;
            }
        } else {
            $rs_url_path['rs[' . $k . ']'] = $v;
        }
    }
    $pagenav = cot_pagenav('plug', array('e' => 'search', 'sq' => $sq, 'tab' => $tab) + $rs_url_path, $d, array_sum($totalitems), $cfg_maxitems);
}
// Search title
$crumbs = array(array(cot_url('plug', 'e=search'), $L['plu_search']));
if (!empty($tab)) {
    $crumbs[] = array(cot_url('plug', 'e=search&tab=' . $tab), $L['plu_tabs_' . $tab]);
}
$out['head'] .= $R['code_noindex'];
$search_subtitle = empty($tab) ? $L['plu_search'] : $L['plu_tabs_' . $tab] . ' - ' . $L['plu_search'];
$out['subtitle'] = empty($sq) ? $search_subtitle : htmlspecialchars(strip_tags($sq)) . ' - ' . $L['plu_result'];
$t->assign(array('PLUGIN_TITLE' => cot_breadcrumbs($crumbs, $cfg['breadcrumb'], true), 'PLUGIN_SEARCH_ACTION' => cot_url('plug', 'e=search&tab=' . $tab), 'PLUGIN_SEARCH_TEXT' => cot_inputbox('text', 'sq', htmlspecialchars($sq), 'size="32" maxlength="' . $cfg['plugin']['search']['maxsigns'] . '"'), 'PLUGIN_SEARCH_USER' => cot_inputbox('text', 'rs[setuser]', htmlspecialchars($rs['setuser']), 'class="userinput" size="32"'), 'PLUGIN_SEARCH_DATE_SELECT' => cot_selectbox($rs['setlimit'], 'rs[setlimit]', range(0, 5), array($L['plu_any_date'], $L['plu_last_2_weeks'], $L['plu_last_1_month'], $L['plu_last_3_month'], $L['plu_last_1_year'], $L['plu_need_datas']), false), 'PLUGIN_SEARCH_DATE_FROM' => cot_selectbox_date($rs['setfrom'], 'short', 'rfrom', cot_date('Y', $sys['now']) + 1), 'PLUGIN_SEARCH_DATE_TO' => cot_selectbox_date($rs['setto'], 'short', 'rto', cot_date('Y', $sys['now']) + 1), 'PLUGIN_SEARCH_FOUND' => array_sum($totalitems) > 0 ? array_sum($totalitems) : '', 'PLUGIN_PAGEPREV' => $pagenav['prev'], 'PLUGIN_PAGENEXT' => $pagenav['next'], 'PLUGIN_PAGENAV' => $pagenav['main']));
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('search.tags') as $pl) {
    include $pl;
}
/* ===== */
Beispiel #15
0
if (empty($rpage['page_cat']) && !empty($c)) {
    $rpage['page_cat'] = $c;
    $usr['isadmin'] = cot_auth('page', $rpage['page_cat'], 'A');
}
$out['subtitle'] = $L['page_addsubtitle'];
$out['head'] .= $R['code_noindex'];
$sys['sublocation'] = $structure['page'][$c]['title'];
$mskin = cot_tplfile(array('page', 'add', $structure['page'][$rpage['page_cat']]['tpl']));
/* === Hook === */
foreach (cot_getextplugins('page.add.main') as $pl) {
    include $pl;
}
/* ===== */
require_once $cfg['system_dir'] . '/header.php';
$t = new XTemplate($mskin);
$pageadd_array = array('PAGEADD_PAGETITLE' => $L['page_addtitle'], 'PAGEADD_SUBTITLE' => $L['page_addsubtitle'], 'PAGEADD_ADMINEMAIL' => "mailto:" . $cfg['adminemail'], 'PAGEADD_FORM_SEND' => cot_url('page', 'm=add&a=add&c=' . $c), 'PAGEADD_FORM_CAT' => cot_selectbox_structure('page', $rpage['page_cat'], 'rpagecat'), 'PAGEADD_FORM_CAT_SHORT' => cot_selectbox_structure('page', $rpage['page_cat'], 'rpagecat', $c), 'PAGEADD_FORM_KEYWORDS' => cot_inputbox('text', 'rpagekeywords', $rpage['page_keywords'], array('size' => '32', 'maxlength' => '255')), 'PAGEADD_FORM_METATITLE' => cot_inputbox('text', 'rpagemetatitle', $rpage['page_metatitle'], array('size' => '64', 'maxlength' => '255')), 'PAGEADD_FORM_METADESC' => cot_textarea('rpagemetadesc', $rpage['page_metadesc'], 2, 64, array('maxlength' => '255')), 'PAGEADD_FORM_ALIAS' => cot_inputbox('text', 'rpagealias', $rpage['page_alias'], array('size' => '32', 'maxlength' => '255')), 'PAGEADD_FORM_TITLE' => cot_inputbox('text', 'rpagetitle', $rpage['page_title'], array('size' => '64', 'maxlength' => '255')), 'PAGEADD_FORM_DESC' => cot_textarea('rpagedesc', $rpage['page_desc'], 2, 64, array('maxlength' => '255')), 'PAGEADD_FORM_AUTHOR' => cot_inputbox('text', 'rpageauthor', $rpage['page_author'], array('size' => '24', 'maxlength' => '100')), 'PAGEADD_FORM_OWNER' => cot_build_user($usr['id'], htmlspecialchars($usr['name'])), 'PAGEADD_FORM_OWNERID' => $usr['id'], 'PAGEADD_FORM_DATE' => cot_selectbox_date($sys['now'], 'long', 'rpagedate'), 'PAGEADD_FORM_BEGIN' => cot_selectbox_date($sys['now'], 'long', 'rpagebegin'), 'PAGEADD_FORM_EXPIRE' => cot_selectbox_date(0, 'long', 'rpageexpire'), 'PAGEADD_FORM_FILE' => cot_selectbox($rpage['page_file'], 'rpagefile', range(0, 2), array($L['No'], $L['Yes'], $L['Members_only']), false), 'PAGEADD_FORM_URL' => cot_inputbox('text', 'rpageurl', $rpage['page_url'], array('size' => '56', 'maxlength' => '255')), 'PAGEADD_FORM_SIZE' => cot_inputbox('text', 'rpagesize', $rpage['page_size'], array('size' => '56', 'maxlength' => '255')), 'PAGEADD_FORM_TEXT' => cot_textarea('rpagetext', $rpage['page_text'], 24, 120, '', 'input_textarea_editor'), 'PAGEADD_FORM_PARSER' => cot_selectbox($cfg['page']['parser'], 'rpageparser', $parser_list, $parser_list, false));
$t->assign($pageadd_array);
// Extra fields
foreach ($cot_extrafields[$db_pages] as $exfld) {
    $uname = strtoupper($exfld['field_name']);
    $exfld_val = cot_build_extrafields('rpage' . $exfld['field_name'], $exfld, $rpage['page_' . $exfld['field_name']]);
    $exfld_title = isset($L['page_' . $exfld['field_name'] . '_title']) ? $L['page_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
    $t->assign(array('PAGEADD_FORM_' . $uname => $exfld_val, 'PAGEADD_FORM_' . $uname . '_TITLE' => $exfld_title, 'PAGEADD_FORM_EXTRAFLD' => $exfld_val, 'PAGEADD_FORM_EXTRAFLD_TITLE' => $exfld_title));
    $t->parse('MAIN.EXTRAFLD');
}
// Error and message handling
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('page.add.tags') as $pl) {
    include $pl;
}
Beispiel #16
0
$title[] = !$id ? $L['pmsend_title'] : $L['Edit'] . ' #' . $id;
$url_newpm = cot_url('pm', 'm=send');
$url_inbox = cot_url('pm');
$url_sentbox = cot_url('pm', 'f=sentbox');
if (COT_AJAX) {
    // Attach rich text editors to AJAX loaded page
    $rc_tmp = $out['footer_rc'];
    $out['footer_rc'] = '';
    if (is_array($cot_plugins['editor'])) {
        foreach ($cot_plugins['editor'] as $k) {
            if ($k['pl_code'] == $editor && cot_auth('plug', $k['pl_code'], 'R')) {
                include $cfg['plugins_dir'] . '/' . $k['pl_file'];
                break;
            }
        }
    }
    $text_editor_code = $out['footer_rc'];
    $out['footer_rc'] = $rc_tmp;
}
$t->assign(array('PMSEND_TITLE' => cot_breadcrumbs($title, $cfg['homebreadcrumb']), 'PMSEND_SENDNEWPM' => $usr['auth_write'] ? cot_rc_link($url_newpm, $L['pm_sendnew'], array('class' => $cfg['pm']['turnajax'] ? 'ajax' : '')) : '', 'PMSEND_SENDNEWPM_URL' => $usr['auth_write'] ? $url_newpm : '', 'PMSEND_INBOX' => cot_rc_link($url_inbox, $L['pm_inbox'], array('class' => $cfg['pm']['turnajax'] ? 'ajax' : '')), 'PMSEND_INBOX_URL' => $url_inbox, 'PMSEND_INBOX_COUNT' => $totalinbox, 'PMSEND_SENTBOX' => cot_rc_link($url_sentbox, $L['pm_sentbox'], array('class' => $cfg['pm']['turnajax'] ? 'ajax' : '')), 'PMSEND_SENTBOX_URL' => $url_sentbox, 'PMSEND_SENTBOX_COUNT' => $totalsentbox, 'PMSEND_FORM_SEND' => cot_url('pm', 'm=send&a=send' . $idurl), 'PMSEND_FORM_TITLE' => cot_inputbox('text', 'newpmtitle', htmlspecialchars($newpmtitle), 'size="56" maxlength="255"'), 'PMSEND_FORM_TEXT' => cot_textarea('newpmtext', $newpmtext, 8, 56, '', 'input_textarea_editor') . $text_editor_code, 'PMSEND_FORM_TOUSER' => cot_textarea('newpmrecipient', $touser, 3, 56, 'class="userinput"'), 'PMSEND_FORM_NOT_TO_SENTBOX' => cot_checkbox(false, 'fromstate', cot::$L['pm_notmovetosentbox'], '', '3')));
/* === Hook === */
foreach (cot_getextplugins('pm.send.tags') as $pl) {
    include $pl;
}
/* ===== */
if (!$id) {
    $t->parse('MAIN.PMSEND_USERLIST');
}
$t->parse('MAIN');
$t->out('MAIN');
require_once $cfg['system_dir'] . '/footer.php';
            $payinfo['pay_adate'] = $sys['now'];
            $payinfo['pay_status'] = 'done';
            $payinfo['pay_desc'] = sprintf($L['payments_balance_transfer_desc'], $usr['name'], $recipient['user_name'], $comment);
            $db->insert($db_payments, $payinfo);
            $pid = $db->lastInsertId();
            // Отправка уведомления админу о переводе между пользователями
            $subject = $L['payments_balance_transfer_admin_subject'];
            $body = sprintf($L['payments_balance_transfer_admin_body'], $usr['name'], $recipient['user_name'], $summ, $taxsumm, $sendersumm, $recipientsumm, $cfg['payments']['valuta'], cot_date('d.m.Y в H:i', $sys['now']), $comment);
            cot_mail($cfg['adminemail'], $subject, $body);
            // Отправка уведомления админу о переводе между пользователями
            $subject = $L['payments_balance_transfer_recipient_subject'];
            $body = sprintf($L['payments_balance_transfer_recipient_body'], $usr['name'], $recipient['user_name'], $summ, $taxsumm, $sendersumm, $recipientsumm, $cfg['payments']['valuta'], cot_date('d.m.Y в H:i', $sys['now']), $comment);
            cot_mail($recipient['user_email'], $subject, $body);
            cot_redirect(cot_url('payments', 'm=balance&n=history', '', true));
        }
        cot_redirect(cot_url('payments', 'm=balance&n=transfer', '', true));
    }
    cot_display_messages($t, 'MAIN.TRANSFERFORM');
    $t->assign(array('TRANSFER_FORM_ACTION_URL' => cot_url('payments', 'm=balance&n=transfer&a=add'), 'TRANSFER_FORM_SUMM' => cot_inputbox('text', 'summ', $summ), 'TRANSFER_FORM_TAX' => $taxsumm, 'TRANSFER_FORM_TOTAL' => !empty($sendersumm) ? $sendersumm : 0, 'TRANSFER_FORM_COMMENT' => $comment, 'TRANSFER_FORM_USERNAME' => $username));
    $t->parse('MAIN.TRANSFERFORM');
}
if ($n == 'history') {
    $pays = $db->query("SELECT * FROM {$db_payments} \n\t\tWHERE pay_userid=" . $usr['id'] . " AND pay_status='done' AND pay_summ>0\n\t\tORDER BY pay_pdate DESC")->fetchAll();
    foreach ($pays as $pay) {
        $t->assign(cot_generate_paytags($pay, 'HIST_ROW_'));
        $t->parse('MAIN.HISTORY.HIST_ROW');
    }
    $t->parse('MAIN.HISTORY');
}
$t->parse('MAIN');
$module_body = $t->text('MAIN');
Beispiel #18
0
}
$toptitle = cot_breadcrumbs(cot_forums_buildpath($s), $cfg['homebreadcrumb']);
$toptitle .= $usr['isadmin'] ? $R['forums_code_admin_mark'] : '';
$sys['sublocation'] = $structure['forums'][$s]['title'];
$out['subtitle'] = $L['forums_newtopic'];
$out['head'] .= $R['code_noindex'];
/* === Hook === */
foreach (cot_getextplugins('forums.newtopic.main') as $pl) {
    include $pl;
}
/* ===== */
require_once cot_incfile('forms');
require_once $cfg['system_dir'] . '/header.php';
$mskin = cot_tplfile(array('forums', 'newtopic', $structure['forums'][$s]['tpl']));
$t = new XTemplate($mskin);
$t->assign(array('FORUMS_NEWTOPIC_PAGETITLE' => $toptitle, 'FORUMS_NEWTOPIC_SUBTITLE' => htmlspecialchars(cot_parse_autourls($structure['forums'][$s]['desc'])), 'FORUMS_NEWTOPIC_SEND' => cot_url('forums', "m=newtopic&a=newtopic&s=" . $s), 'FORUMS_NEWTOPIC_TITLE' => cot_inputbox('text', 'rtopictitle', $rtopic['ft_title'], array('size' => 56, 'maxlength' => 255)), 'FORUMS_NEWTOPIC_DESC' => cot_inputbox('text', 'rtopicdesc', $rtopic['ft_desc'], array('size' => 56, 'maxlength' => 255)), 'FORUMS_NEWTOPIC_TEXT' => cot_textarea('rmsgtext', $rmsg['fp_text'], 20, 56, '', 'input_textarea_' . $minimaxieditor), 'FORUMS_NEWTOPIC_EDITTIMEOUT' => cot_build_timegap(0, $cfg['forums']['edittimeout'] * 3600)));
// Extra fields
foreach ($cot_extrafields[$db_forum_posts] as $exfld) {
    $uname = strtoupper($exfld['field_name']);
    $exfld_val = cot_build_extrafields('rmsg' . $exfld['field_name'], $exfld, $rmsg['fp_' . $exfld['field_name']]);
    $exfld_title = isset($L['forums_posts_' . $exfld['field_name'] . '_title']) ? $L['forums_posts_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
    $t->assign(array('FORUMS_NEWTOPIC_' . $uname => $exfld_val, 'FORUMS_NEWTOPIC_' . $uname . '_TITLE' => $exfld_title, 'FORUMS_NEWTOPIC_EXTRAFLD' => $exfld_val, 'FORUMS_NEWTOPIC_EXTRAFLD_TITLE' => $exfld_title));
    $t->parse('MAIN.EXTRAFLD');
}
// Extra fields
foreach ($cot_extrafields[$db_forum_topics] as $exfld) {
    $uname = strtoupper($exfld['field_name']);
    $exfld_val = cot_build_extrafields('rtopic' . $exfld['field_name'], $exfld, $rtopic['ft_' . $exfld['field_name']]);
    $exfld_title = isset($L['forums_topics_' . $exfld['field_name'] . '_title']) ? $L['forums_topics_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
    $t->assign(array('FORUMS_NEWTOPIC_TOPIC_' . $uname => $exfld_val, 'FORUMS_NEWTOPIC_TOPIC_' . $uname . '_TITLE' => $exfld_title, 'FORUMS_NEWTOPIC_TOPIC_EXTRAFLD' => $exfld_val, 'FORUMS_NEWTOPIC_TOPIC_EXTRAFLD_TITLE' => $exfld_title));
    $t->parse('MAIN.TOPIC_EXTRAFLD');
        $variants = cot_import($variantss[$name], 'D', "HTM");
        $default = cot_import($defaults[$name], 'D', "HTM");
        $type = cot_import($types[$name], 'D', "INT");
        cfg_editor::config_edit($c, $name, $order, $title, $desc, $type, $default, $variants);
    }
    cot_message('updated_success');
    $cache && $cache->clear();
    cot_redirect(cot_url('admin', array('m' => 'other', 'p' => 'configeditor', 'n' => 'edit', 'c' => $c), '', true));
}
if ($a == 'delete') {
    cot_check_xg();
    $name = cot_import('rname', 'G', "ALP");
    cfg_editor::config_delete($c, $name);
    cot_message('deleted_success');
    $cache && $cache->clear();
    cot_redirect(cot_url('admin', array('m' => 'other', 'p' => 'configeditor', 'n' => 'edit', 'c' => $c), '', true));
}
$rows = cfg_editor::config_list($c);
foreach ($rows as $row) {
    $readonly = array();
    if ($row['config_donor'] != 'configeditor') {
        $readonly = array('readonly' => 'readonly', 'disabled' => 'disabled');
    }
    $t->assign(array('FORM_EDIT_NAME' => $row['config_name'], 'FORM_EDIT_TITLE' => cot_inputbox('text', 'rtitle[' . $row['config_name'] . ']', isset($L['cfg_' . $row['config_name']]) ? $L['cfg_' . $row['config_name']] : $row['config_text'], array('maxlength' => '255') + $readonly), 'FORM_EDIT_DESC' => cot_textarea('rdesc[' . $row['config_name'] . ']', isset($L['cfg_' . $row['config_name'] . '_hint']) ? $L['cfg_' . $row['config_name'] . '_hint'] : $row['config_desc'], 2, 60, array('maxlength' => '255') + $readonly), 'FORM_EDIT_ORDER' => cot_inputbox('text', 'rorder[' . $row['config_name'] . ']', $row['config_order'], array('maxlength' => '2') + $readonly), 'FORM_EDIT_VARIANTS' => cot_textarea('rvariants[' . $row['config_name'] . ']', $row['config_variants'], 2, 60, array('maxlength' => '255') + $readonly), 'FORM_EDIT_DEFAULT' => cot_textarea('rdefault[' . $row['config_name'] . ']', $row['config_default'], 2, 60, array('maxlength' => '255') + $readonly), 'FORM_EDIT_TYPE' => cot_selectbox($row['config_type'], 'rtype[' . $row['config_name'] . ']', array_keys($types_array), array_values($types_array), false, $readonly), 'FORM_EDIT_DELETE_URL' => $row['config_donor'] != 'configeditor' ? '' : cot_url('admin', array('m' => 'other', 'p' => 'configeditor', 'n' => 'edit', 'c' => $c, 'a' => 'delete', 'rname' => $row['config_name'], 'x' => $sys['xk']))));
    $t->parse('MAIN.ROW');
}
if (!count($rows)) {
    $t->parse('MAIN.NOROW');
}
$t->assign(array('FORM_EDIT_URL' => cot_url('admin', array('m' => 'other', 'p' => 'configeditor', 'n' => 'edit', 'a' => 'update', 'c' => $c)), 'FORM_ADD_URL' => cot_url('admin', array('m' => 'other', 'p' => 'configeditor', 'n' => 'edit', 'a' => 'add', 'c' => $c)), 'FORM_ADD_TITLE' => cot_inputbox('text', 'rtitle', '', array('maxlength' => '255')), 'FORM_ADD_NAME' => cot_inputbox('text', 'rname', '', array('size' => '20', 'maxlength' => '32')), 'FORM_ADD_DESC' => cot_textarea('rdesc', '', 2, 60), 'FORM_ADD_ORDER' => cot_inputbox('text', 'rorder', '', array('maxlength' => '2')), 'FORM_ADD_VARIANTS' => cot_textarea('rvariants', '', 2, 60), 'FORM_ADD_DEFAULT' => cot_textarea('rdefault', '', 2, 60), 'FORM_ADD_TYPE' => cot_selectbox(0, 'rtype', array_keys($types_array), array_values($types_array), false)));
cot_display_messages($t);
Beispiel #20
0
        foreach (cot_getextplugins('users.auth.check.fail') as $pl) {
            include $pl;
        }
        /* ===== */
        cot_redirect(cot_url('message', 'msg=151', '', true));
    }
}
/* === Hook === */
foreach (cot_getextplugins('users.auth.main') as $pl) {
    include $pl;
}
/* ===== */
$out['subtitle'] = $L['aut_logintitle'];
$out['head'] .= $R['code_noindex'];
require_once $cfg['system_dir'] . '/header.php';
$mskin = file_exists(cot_tplfile('login', 'core')) ? cot_tplfile('login', 'core') : cot_tplfile('users.auth', 'module');
$t = new XTemplate($mskin);
require_once cot_incfile('forms');
if ($cfg['maintenance']) {
    $t->assign(array('USERS_AUTH_MAINTENANCERES' => $cfg['maintenancereason']));
    $t->parse('MAIN.USERS_AUTH_MAINTENANCE');
}
$t->assign(array('USERS_AUTH_TITLE' => $L['aut_logintitle'], 'USERS_AUTH_SEND' => cot_url('login', 'a=check' . (empty($redirect) ? '' : "&redirect={$redirect}")), 'USERS_AUTH_USER' => cot_inputbox('text', 'rusername', $rusername, array('size' => '12', 'maxlength' => '100')), 'USERS_AUTH_PASSWORD' => cot_inputbox('password', 'rpassword', '', array('size' => '12', 'maxlength' => '32')), 'USERS_AUTH_REGISTER' => cot_url('users', 'm=register'), 'USERS_AUTH_REMEMBER' => $cfg['forcerememberme'] ? $R['form_guest_remember_forced'] : $R['form_guest_remember']));
/* === Hook === */
foreach (cot_getextplugins('users.auth.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$t->out('MAIN');
require_once $cfg['system_dir'] . '/footer.php';
[END_COT_EXT]
==================== */
defined('COT_CODE') or die('Wrong URL');
require_once cot_incfile('usercategories', 'plug');
$adminhelp = $L['usercategories_help'];
if ($p == 'usercategories' && $row['config_name'] == 'catslimit' && $cfg['jquery']) {
    $sskin = cot_tplfile('usercategories.admin.config', 'plug', true);
    $tt = new XTemplate($sskin);
    $tpaset = str_replace("\r\n", "\n", $row['config_value']);
    $tpaset = explode("\n", $tpaset);
    $jj = 0;
    foreach ($tpaset as $lineset) {
        $lines = explode("|", $lineset);
        $lines[0] = (int) trim($lines[0]);
        $lines[1] = (int) trim($lines[1]);
        $lines[2] = (int) trim($lines[2]);
        if ($lines[0] > 0) {
            $tt->assign(array('ADDNUM' => $jj, 'ADDGROUP' => cot_selectbox_groups($lines[0], 'groupid' . $jj, array(1, 2, 3, 5, 6), 'class="area_groupid"'), 'ADDLIMIT1' => cot_inputbox('text', 'limit1', $lines[1], 'class="area_limit1"'), 'ADDLIMIT2' => cot_inputbox('text', 'limit2', $lines[2], 'class="area_limit2"')));
            $tt->parse('MAIN.ADDITIONAL');
            $jj++;
        }
    }
    if ($jj == 0) {
        $tt->assign(array('ADDNUM' => $jj, 'ADDGROUP' => cot_selectbox_groups('', 'groupid' . $jj, array(1, 2, 3, 5, 6), 'class="area_groupid"'), 'ADDLIMIT1' => cot_inputbox('text', 'limit1', 0, 'class="area_limit1"'), 'ADDLIMIT2' => cot_inputbox('text', 'limit2', 0, 'class="area_limit2"')));
        $tt->parse('MAIN.ADDITIONAL');
    }
    $jj++;
    $tt->assign(array('CATNUM' => $jj));
    $tt->parse('MAIN');
    $t->assign(array('ADMIN_CONFIG_ROW_CONFIG_MORE' => $tt->text('MAIN') . '<div id="helptext">' . $config_more . '</div>'));
}
Beispiel #22
0
    $sql_pfs_update = $db->query("UPDATE {$db_pfs} SET\n\t\tpfs_desc='" . $db->prep($rdesc) . "',\n\t\tpfs_folderid={$folderid}\n\t\tWHERE pfs_userid={$userid} AND pfs_id={$id}");
    cot_redirect(cot_url('pfs', "f={$pfs_folderid}&" . $more, '', true));
}
/* ============= */
$out['subtitle'] = $L['pfs_title'];
if (!$standalone) {
    require_once $cfg['system_dir'] . '/header.php';
}
$t = new XTemplate(cot_tplfile('pfs.edit'));
if ($standalone) {
    cot_sendheaders();
    $html = Resources::render();
    if ($html) {
        $out['head_head'] = $html . $out['head_head'];
    }
    $t->assign(array('PFS_HEAD' => $out['head_head']));
    $t->parse('MAIN.STANDALONE_HEADER');
    $t->parse('MAIN.STANDALONE_FOOTER');
}
$t->assign(array('PFS_TITLE' => cot_breadcrumbs($title, $cfg['homebreadcrumb']), 'PFS_ACTION' => cot_url('pfs', 'm=edit&a=update&id=' . $pfs_id . '&' . $more), 'PFS_FILE' => $pfs_file, 'PFS_DATE' => cot_date('datetime_medium', $pfs_date), 'PFS_DATE_STAMP' => $pfs_date, 'PFS_FOLDER' => cot_selectbox_folders($userid, '', $pfs_folderid), 'PFS_URL' => $ff, 'PFS_DESC' => cot_inputbox('text', 'rdesc', $pfs_desc, 'size="56" maxlength="255"'), 'PFS_SIZE' => cot_build_filesize($pfs_size_bytes, 1), 'PFS_SIZE_BYTES' => $pfs_size_bytes, 'PFS_SIZE_KB' => $pfs_size_bytes / 1024));
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('pfs.edit.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$t->out('MAIN');
if (!$standalone) {
    require_once $cfg['system_dir'] . '/footer.php';
}
    /* === Hook - Part4 : Include === */
    foreach ($extp4 as $pl) {
        include $pl;
    }
    /* ===== */
    $t_o->parse("MAIN.ROWS");
}
$addoffer_enabled = true;
/* === Hook === */
foreach (cot_getextplugins('projects.addofferform.main') as $pl) {
    include $pl;
}
/* ===== */
$sql = $db->query("SELECT * FROM {$db_projects_offers} WHERE offer_pid=" . $id . " AND offer_userid=" . $usr['id'] . "");
if ($sql->fetchColumn() == 0 && $addoffer_enabled && $usr['auth_offers'] && $usr['id'] != $item['item_userid'] && empty($performer)) {
    $t_o->assign(array("OFFER_FORM_COSTMIN" => cot_inputbox('text', 'costmin', $roffer['offer_cost_min'], 'size="7"'), "OFFER_FORM_COSTMAX" => cot_inputbox('text', 'costmax', $roffer['offer_cost_max'], 'size="7"'), "OFFER_FORM_TIMEMIN" => cot_inputbox('text', 'timemin', $roffer['offer_time_min'], 'size="7"'), "OFFER_FORM_TIMEMAX" => cot_inputbox('text', 'timemax', $roffer['offer_time_max'], 'size="7"'), "OFFER_FORM_TEXT" => cot_textarea('offertext', $roffer['offer_text'], 7, 40), "OFFER_FORM_HIDDEN" => cot_checkbox(0, 'hidden', $L['offers_hide_offer']), "OFFER_FORM_ACTION_URL" => cot_url('projects', 'id=' . $id . '&a=addoffer'), "OFFER_FORM_TIMETYPE" => cot_selectbox($timetype, 'timetype', array_keys($L['offers_timetype']), array_values($L['offers_timetype']), false)));
    // Extra fields
    foreach ($cot_extrafields[$db_projects_offers] as $exfld) {
        $uname = strtoupper($exfld['field_name']);
        $exfld_val = cot_build_extrafields('roffer' . $exfld['field_name'], $exfld, $roffer['offer_' . $exfld['field_name']]);
        $exfld_title = isset($L['offers_' . $exfld['field_name'] . '_title']) ? $L['offers_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
        $t_o->assign(array('OFFER_FORM_' . $uname => $exfld_val, 'OFFER_FORM_' . $uname . '_TITLE' => $exfld_title, 'OFFER_FORM_EXTRAFLD' => $exfld_val, 'OFFER_FORM_EXTRAFLD_TITLE' => $exfld_title));
        $t_o->parse('MAIN.EXTRAFLD');
    }
    /* === Hook === */
    foreach (cot_getextplugins('projects.addofferform.tags') as $pl) {
        include $pl;
    }
    /* ===== */
    $t_o->parse("MAIN.ADDOFFERFORM");
}
 public function upload_form()
 {
     global $cfg, $L;
     $mskin = cot_tplfile(array('mavatars', 'form', $this->extension, $this->category, $this->code), 'plug');
     $t = new XTemplate($mskin);
     foreach ($this->mavatars as $key => $mavatar) {
         $t->assign($this->object_edittags($mavatar));
         $t->parse("MAIN.FILES.ROW");
     }
     if (count($this->mavatars) > 0) {
         $t->parse("MAIN.FILES");
     }
     $t->assign("FILEUPLOAD_INPUT", cot_inputbox('file', 'mavatar_file[]', ''));
     if ($cfg['jquery'] && $cfg['plugin']['mavatars']['turnajax']) {
         $t->assign("FILEUPLOAD_URL", cot_url('plug', 'r=mavatars&m=upload&ext=' . $this->extension . '&cat=' . $this->category . '&code=' . $this->code . '&' . cot_xg(), '', true));
         $t->parse("MAIN.AJAXUPLOAD");
     } else {
         $t->parse("MAIN.UPLOAD");
     }
     if ($cfg['plugin']['mavatars']['turncurl']) {
         $t->assign("CURLUPLOAD_INPUT", cot_inputbox('text', 'mavatar_curlfile[]', ''));
         $t->parse("MAIN.CURLUPLOAD");
     }
     $t->parse("MAIN");
     return $t->text("MAIN");
 }
Beispiel #25
0
if (empty($ritem['item_type']) && !empty($type)) {
    $ritem['item_type'] = $type;
}
$out['subtitle'] = $L['projects_add_project_title'];
$out['head'] .= $R['code_noindex'];
$sys['sublocation'] = $structure['projects'][$c]['title'];
$mskin = cot_tplfile(array('projects', 'add', $structure['projects'][$ritem['item_cat']]['tpl']));
/* === Hook === */
foreach (cot_getextplugins('projects.add.main') as $pl) {
    include $pl;
}
/* ===== */
$t = new XTemplate($mskin);
// Error and message handling
cot_display_messages($t);
$t->assign(array("PRJADD_FORM_SEND" => cot_url('projects', 'm=add&c=' . $c . '&type=' . $type . '&a=add'), "PRJADD_FORM_CAT" => cot_selectbox_structure('projects', $ritem['item_cat'], 'rcat'), "PRJADD_FORM_CATTITLE" => !empty($c) ? $structure['projects'][$c]['title'] : '', "PRJADD_FORM_TYPE" => is_array($projects_types) ? cot_selectbox($ritem['item_type'] ? $ritem['item_type'] : $cfg['projects']['default_type'], 'rtype', array_keys($projects_types), array_values($projects_types)) : 'empty', "PRJADD_FORM_TYPETITLE" => is_array($projects_types) && !empty($type) ? $projects_types[$type] : '', "PRJADD_FORM_TITLE" => cot_inputbox('text', 'rtitle', $ritem['item_title'], 'size="56"'), "PRJADD_FORM_ALIAS" => cot_inputbox('text', 'ralias', $ritem['item_alias'], array('size' => '32', 'maxlength' => '255')), "PRJADD_FORM_TEXT" => cot_textarea('rtext', $ritem['item_text'], 10, 60, 'id="formtext"', $prjeditor ? 'input_textarea_' . $prjeditor : ''), "PRJADD_FORM_COST" => cot_inputbox('text', 'rcost', $ritem['item_cost'], 'size="10"'), "PRJADD_FORM_PARSER" => cot_selectbox($cfg['projects']['parser'], 'rparser', $parser_list, $parser_list, false)));
// Extra fields
foreach ($cot_extrafields[$db_projects] as $exfld) {
    $uname = strtoupper($exfld['field_name']);
    $exfld_val = cot_build_extrafields('ritem' . $exfld['field_name'], $exfld, $ritem['item_' . $exfld['field_name']]);
    $exfld_title = isset($L['projects_' . $exfld['field_name'] . '_title']) ? $L['projects_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
    $t->assign(array('PRJADD_FORM_' . $uname => $exfld_val, 'PRJADD_FORM_' . $uname . '_TITLE' => $exfld_title, 'PRJADD_FORM_EXTRAFLD' => $exfld_val, 'PRJADD_FORM_EXTRAFLD_TITLE' => $exfld_title));
    $t->parse('MAIN.EXTRAFLD');
}
/* === Hook === */
foreach (cot_getextplugins('projects.add.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$module_body = $t->text('MAIN');
<?php

defined('COT_CODE') or die('Wrong URL');
/* ====================
[BEGIN_COT_EXT]
Hooks=projects.add.tags
Tags=projects.add.tpl:{PRJADD_FORM_POSTBYUSER}
[END_COT_EXT]
==================== */
if ($usr['isadmin']) {
    $t->assign("PRJADD_FORM_POSTBYUSER", cot_inputbox('text', 'rpostbyuser_projects', $postbyuser['projects'], 'size="30" class="userinput"'));
}
Beispiel #27
0
/**
 * Returns config input
 * @param array $cfg_var Array with config Variable parameters
 * @return string
 */
function cot_config_input($cfg_var)
{
    $name = $cfg_var['config_name'];
    $type = $cfg_var['config_type'];
    $value = $cfg_var['config_value'];
    $options = $cfg_var['config_variants'];
    $config_input = '';
    switch ($type) {
        case COT_CONFIG_TYPE_STRING:
            $config_input = cot_inputbox('text', $name, $value);
            break;
        case COT_CONFIG_TYPE_SELECT:
            if (!empty($options)) {
                $params = explode(',', $options);
                $params_titles = cot_config_selecttitles($name, $params);
            }
            $config_input = is_array($params) ? cot_selectbox($value, $name, $params, $params_titles, false) : cot_inputbox('text', $name, $value);
            break;
        case COT_CONFIG_TYPE_RADIO:
            global $L;
            if (!empty($options)) {
                $params = explode(',', $options);
                $params_titles = cot_config_selecttitles($name, $params);
                if (empty($value)) {
                    $value = $cfg_var['config_default'];
                }
            } else {
                $params = array(1, 0);
                $params_titles = array($L['Yes'], $L['No']);
            }
            $config_input = cot_radiobox($value, $name, $params, $params_titles, '', ' ');
            break;
        case COT_CONFIG_TYPE_RANGE:
            $range = preg_split('#\\s*,\\s*#', $options);
            $params = range($range[0], $range[1], empty($range[2]) ? 1 : $range[2]);
            $config_input = cot_selectbox($value, $name, $params, $params, false);
            break;
        case COT_CONFIG_TYPE_CUSTOM:
            if (preg_match('#^(\\w+)\\((.*?)\\)$#', $options, $mt) && function_exists($mt[1])) {
                $callback_params = preg_split('#\\s*,\\s*#', $mt[2]);
                if (count($callback_params) > 0 && !empty($callback_params[0])) {
                    for ($i = 0; $i < count($callback_params); $i++) {
                        $callback_params[$i] = str_replace(array("'", '"'), array('', ''), $callback_params[$i]);
                    }
                }
                $config_input = call_user_func_array($mt[1], array_merge(array($cfg_var), $callback_params));
            } else {
                $config_input = cot_inputbox('text', $name, $value);
            }
            break;
        case COT_CONFIG_TYPE_CALLBACK:
            if (preg_match('#^(\\w+)\\((.*?)\\)$#', $options, $mt) && function_exists($mt[1])) {
                $callback_params = preg_split('#\\s*,\\s*#', $mt[2]);
                if (count($callback_params) > 0 && !empty($callback_params[0])) {
                    for ($i = 0; $i < count($callback_params); $i++) {
                        $callback_params[$i] = str_replace("'", '', $callback_params[$i]);
                        $callback_params[$i] = str_replace('"', '', $callback_params[$i]);
                    }
                    $params = call_user_func_array($mt[1], $callback_params);
                } else {
                    $params = call_user_func($mt[1]);
                }
                // assume associative array as value=>title
                $assoc = range(0, count($params) - 1) != array_keys($params);
                if ($assoc) {
                    $assoc_titles = array_values($params);
                    $params = array_keys($params);
                }
                $params_titles = cot_config_selecttitles($name, $params);
                if ($assoc && $params_titles == $params) {
                    $params_titles = $assoc_titles;
                }
                $config_input = cot_selectbox($value, $name, $params, $params_titles, false);
            }
            break;
        case COT_CONFIG_TYPE_HIDDEN:
        case COT_CONFIG_TYPE_SEPARATOR:
            break;
        default:
            $config_input = cot_textarea($name, $value, 8, 56);
            break;
    }
    return $config_input;
}
Beispiel #28
0
$toptitle .= $usr['isadmin'] ? $R['forums_code_admin_mark'] : '';
$sys['sublocation'] = $structure['forums'][$s]['title'];
$title_params = array('FORUM' => $L['Forums'], 'SECTION' => $structure['forums'][$s]['title'], 'TOPIC' => $rowt['ft_title'], 'EDIT' => $L['Edit']);
$out['subtitle'] = cot_title('{EDIT} - {TOPIC}', $title_params);
$out['head'] .= $R['code_noindex'];
/* === Hook === */
foreach (cot_getextplugins('forums.editpost.main') as $pl) {
    include $pl;
}
/* ===== */
require_once $cfg['system_dir'] . '/header.php';
$mskin = cot_tplfile(array('forums', 'editpost', $structure['forums'][$s]['tpl']));
$t = new XTemplate($mskin);
cot_display_messages($t);
if ($db->query("SELECT fp_id FROM {$db_forum_posts} WHERE fp_topicid = {$q} ORDER BY fp_id ASC LIMIT 1")->fetchColumn() == $p) {
    $t->assign(array('FORUMS_EDITPOST_TOPICTITTLE' => cot_inputbox('text', 'rtopictitle', $rowt['ft_title'], array('size' => 56, 'maxlength' => 255)), 'FORUMS_EDITPOST_TOPICDESCRIPTION' => cot_inputbox('text', 'rtopicdesc', $rowt['ft_desc'], array('size' => 56, 'maxlength' => 255))));
    // Extra fields
    foreach ($cot_extrafields[$db_forum_topics] as $exfld) {
        $uname = strtoupper($exfld['field_name']);
        $exfld_val = cot_build_extrafields('rtopic' . $exfld['field_name'], $exfld, $rowt['ft_' . $exfld['field_name']]);
        $exfld_title = isset($L['forums_topics_' . $exfld['field_name'] . '_title']) ? $L['forums_topics_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
        $t->assign(array('FORUMS_EDITPOST_TOPIC_' . $uname => $exfld_val, 'FORUMS_EDITPOST_TOPIC_' . $uname . '_TITLE' => $exfld_title, 'FORUMS_EDITPOST_TOPIC_EXTRAFLD' => $exfld_val, 'FORUMS_EDITPOST_TOPIC_EXTRAFLD_TITLE' => $exfld_title));
        $t->parse('MAIN.FORUMS_EDITPOST_FIRSTPOST.TOPIC_EXTRAFLD');
    }
    $t->parse('MAIN.FORUMS_EDITPOST_FIRSTPOST');
}
$t->assign(array('FORUMS_EDITPOST_PAGETITLE' => $toptitle, 'FORUMS_EDITPOST_SUBTITLE' => $L['forums_postedby'] . ": <a href=\"users.php?m=details&id=" . $rowpost['fp_posterid'] . "\">" . $rowpost['fp_postername'] . "</a> @ " . cot_date('datetime_medium', $rowpost['fp_updated']), 'FORUMS_EDITPOST_UPDATED' => cot_date('datetime_medium', $rowpost['fp_updated']), 'FORUMS_EDITPOST_UPDATED_STAMP' => $rowpost['fp_updated'], 'FORUMS_EDITPOST_SEND' => cot_url('forums', "m=editpost&a=update&s=" . $s . "&q=" . $q . "&p=" . $p . '&d=' . $durl . "&" . cot_xg()), 'FORUMS_EDITPOST_TEXT' => cot_textarea('rmsgtext', $rowpost['fp_text'], 20, 56, '', 'input_textarea_' . $minimaxieditor), 'FORUMS_EDITPOST_EDITTIMEOUT' => cot_build_timegap(0, $cfg['forums']['edittimeout'] * 3600)));
// Extra fields
foreach ($cot_extrafields[$db_forum_posts] as $exfld) {
    $uname = strtoupper($exfld['field_name']);
    $exfld_val = cot_build_extrafields('rmsg' . $exfld['field_name'], $exfld, $rowpost['fp_' . $exfld['field_name']]);
         /* ===== */
         $t->assign('CONFIG_HIDDEN', cot_inputbox('hidden', 'editconfig', $structure_code));
         $t->parse('MAIN.OPTIONS.CONFIG');
     }
     $t->parse($id || !empty($al) ? 'MAIN.OPTIONS' : 'MAIN.DEFAULT.ROW');
 }
 if (!$id && empty($al)) {
     $t->assign(array('ADMIN_STRUCTURE_PAGINATION_PREV' => $pagenav['prev'], 'ADMIN_STRUCTURE_PAGNAV' => $pagenav['main'], 'ADMIN_STRUCTURE_PAGINATION_NEXT' => $pagenav['next'], 'ADMIN_STRUCTURE_TOTALITEMS' => $totalitems, 'ADMIN_STRUCTURE_COUNTER_ROW' => $ii));
     $t->parse('MAIN.DEFAULT');
     // flush post buffer if it contains Update Table data
     $uri = str_replace('&_ajax=1', '', $_SERVER['REQUEST_URI']);
     $hash = md5($uri);
     if (is_array($_SESSION['cot_buffer'][$hash]['rstructurecode'])) {
         unset($_SESSION['cot_buffer'][$hash]);
     }
     $t->assign(array('ADMIN_STRUCTURE_URL_FORM_ADD' => cot_url('admin', 'm=structure&n=' . $n . '&mode=' . $mode . '&a=add&d=' . $durl), 'ADMIN_STRUCTURE_CODE' => cot_inputbox('text', 'rstructurecode', null, 'size="16"'), 'ADMIN_STRUCTURE_PATH' => cot_inputbox('text', 'rstructurepath', null, 'size="16" maxlength="16"'), 'ADMIN_STRUCTURE_TITLE' => cot_inputbox('text', 'rstructuretitle', null, 'size="64" maxlength="100"'), 'ADMIN_STRUCTURE_DESC' => cot_inputbox('text', 'rstructuredesc', null, 'size="64" maxlength="255"'), 'ADMIN_STRUCTURE_ICON' => cot_inputbox('text', 'rstructureicon', null, 'size="64" maxlength="128"'), 'ADMIN_STRUCTURE_LOCKED' => cot_checkbox(null, 'rstructurelocked'), 'ADMIN_STRUCTURE_TPLMODE' => cot_radiobox(null, 'rtplmode', array('1', '2', '3'), array($L['adm_tpl_empty'], $L['adm_tpl_parent'], $L['adm_tpl_forced']), '', '<br />')));
     // Extra fields
     foreach ($cot_extrafields[$db_structure] as $exfld) {
         $exfld_val = cot_build_extrafields('rstructure' . $exfld['field_name'], $exfld, null);
         $exfld_title = isset($L['structure_' . $exfld['field_name'] . '_title']) ? $L['structure_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
         $t->assign(array('ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) => $exfld_val, 'ADMIN_STRUCTURE_' . strtoupper($exfld['field_name']) . '_TITLE' => $exfld_title, 'ADMIN_STRUCTURE_EXTRAFLD' => $exfld_val, 'ADMIN_STRUCTURE_EXTRAFLD_TITLE' => $exfld_title));
         $t->parse('MAIN.NEWCAT.EXTRAFLD');
     }
     $t->parse('MAIN.NEWCAT');
 }
 cot_display_messages($t);
 /* === Hook  === */
 foreach (cot_getextplugins('admin.structure.tags') as $pl) {
     include $pl;
 }
 /* ===== */
Beispiel #30
0
if (empty($ritem['item_type']) && !empty($type)) {
    $ritem['item_type'] = $type;
}
$out['subtitle'] = $L['folio_add_work_title'];
$out['head'] .= $R['code_noindex'];
$sys['sublocation'] = $structure['folio'][$c]['title'];
$mskin = cot_tplfile(array('folio', 'add', $structure['folio'][$ritem['item_cat']]['tpl']));
/* === Hook === */
foreach (cot_getextplugins('folio.add.main') as $pl) {
    include $pl;
}
/* ===== */
$t = new XTemplate($mskin);
// Error and message handling
cot_display_messages($t);
$t->assign(array("PRDADD_FORM_SEND" => cot_url('folio', 'm=add&c=' . $c . '&a=add'), "PRDADD_FORM_CAT" => cot_selectbox_structure('folio', $ritem['item_cat'], 'rcat'), "PRDADD_FORM_CATTITLE" => !empty($c) ? $structure['folio'][$c]['title'] : '', "PRDADD_FORM_TITLE" => cot_inputbox('text', 'rtitle', $ritem['item_title'], 'size="56"'), "PRDADD_FORM_ALIAS" => cot_inputbox('text', 'ralias', $ritem['item_alias'], array('size' => '32', 'maxlength' => '255')), "PRDADD_FORM_TEXT" => cot_textarea('rtext', $ritem['item_text'], 10, 60, 'id="formtext"', 'input_textarea_editor'), "PRDADD_FORM_COST" => cot_inputbox('text', 'rcost', $ritem['item_cost'], 'size="10"'), "PRDADD_FORM_PARSER" => cot_selectbox($cfg['folio']['parser'], 'rparser', $parser_list, $parser_list, false)));
// Extra fields
foreach ($cot_extrafields[$db_folio] as $exfld) {
    $uname = strtoupper($exfld['field_name']);
    $exfld_val = cot_build_extrafields('ritem' . $exfld['field_name'], $exfld, $ritem['item_' . $exfld['field_name']]);
    $exfld_title = isset($L['folio_' . $exfld['field_name'] . '_title']) ? $L['folio_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
    $t->assign(array('PRDADD_FORM_' . $uname => $exfld_val, 'PRDADD_FORM_' . $uname . '_TITLE' => $exfld_title, 'PRDADD_FORM_EXTRAFLD' => $exfld_val, 'PRDADD_FORM_EXTRAFLD_TITLE' => $exfld_title));
    $t->parse('MAIN.EXTRAFLD');
}
/* === Hook === */
foreach (cot_getextplugins('folio.add.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$module_body = $t->text('MAIN');