当前位置: 首页>>代码示例>>PHP>>正文


PHP cot_checkbox函数代码示例

本文整理汇总了PHP中cot_checkbox函数的典型用法代码示例。如果您正苦于以下问题:PHP cot_checkbox函数的具体用法?PHP cot_checkbox怎么用?PHP cot_checkbox使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cot_checkbox函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cot_poll_edit_form

/**
 * 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;
}
开发者ID:Logodeveloper,项目名称:valencia,代码行数:67,代码来源:polls.functions.php

示例2: form_structure_editor

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');
}
开发者ID:esclkm,项目名称:cot-cateditor,代码行数:52,代码来源:cateditor.admin.edit.php

示例3: form_structure_new

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');
}
开发者ID:esclkm,项目名称:cot-cateditor,代码行数:15,代码来源:cateditor.admin.new.php

示例4: array

$urr = $sql->fetch();
$title_params = array('EDIT' => $L['Edit'], 'NAME' => $urr['user_name']);
$out['subtitle'] = cot_title('{EDIT} - {NAME}', $title_params);
$out['head'] .= $R['code_noindex'];
$mskin = cot_tplfile(array('users', 'edit', $usr['maingrp']), 'module');
/* === Hook === */
foreach (cot_getextplugins('users.edit.main') as $pl) {
    include $pl;
}
/* ===== */
require_once $cfg['system_dir'] . '/header.php';
$t = new XTemplate($mskin);
require_once cot_incfile('forms');
$protected = $sys['protecttopadmin'] ? array('disabled' => 'disabled') : array();
$editor_class = $cfg['users']['usertextimg'] ? 'minieditor' : '';
$delete_pfs = cot_module_active('pfs') ? cot_checkbox(false, 'ruserdelpfs', $L['PFS']) : '';
$t->assign(array('USERS_EDIT_TITLE' => cot_breadcrumbs(array(array(cot_url('users'), $L['Users']), array(cot_url('users', 'm=details&id=' . $urr['user_id'] . '&u=' . $urr['user_name']), $urr['user_name']), array(cot_url('users', 'm=edit&id=' . $urr['user_id']), $L['Edit'])), $cfg['homebreadcrumb']), 'USERS_EDIT_DETAILSLINK' => cot_url('users', 'm=details&id=' . $urr['user_id']), 'USERS_EDIT_EDITLINK' => cot_url('users', 'm=edit&id=' . $urr['user_id']), 'USERS_EDIT_SUBTITLE' => $L['useed_subtitle'], 'USERS_EDIT_SEND' => cot_url('users', 'm=edit&a=update&' . cot_xg() . '&id=' . $urr['user_id']), 'USERS_EDIT_ID' => $urr['user_id'], 'USERS_EDIT_NAME' => cot_inputbox('text', 'rusername', $urr['user_name'], array('size' => 32, 'maxlength' => 100) + $protected), 'USERS_EDIT_ACTIVE' => $user_form_active, 'USERS_EDIT_BANNED' => $user_form_banned, 'USERS_EDIT_THEME' => cot_inputbox('text', 'rusertheme', $urr['user_theme'], array('size' => 32, 'maxlength' => 32)), 'USERS_EDIT_LANG' => cot_inputbox('text', 'ruserlang', $urr['user_lang'], array('size' => 32, 'maxlength' => 32)), 'USERS_EDIT_NEWPASS' => cot_inputbox('password', 'rusernewpass', '', array('size' => 12, 'maxlength' => 32, 'autocomplete' => 'off') + $protected), 'USERS_EDIT_MAINGRP' => cot_build_group($urr['user_maingrp']), 'USERS_EDIT_GROUPS' => cot_build_groupsms($urr['user_id'], $usr['isadmin'], $urr['user_maingrp']), 'USERS_EDIT_COUNTRY' => cot_selectbox_countries($urr['user_country'], 'rusercountry'), 'USERS_EDIT_EMAIL' => cot_inputbox('text', 'ruseremail', $urr['user_email'], array('size' => 32, 'maxlength' => 64)), 'USERS_EDIT_HIDEEMAIL' => cot_radiobox($urr['user_hideemail'], 'ruserhideemail', array(1, 0), array($L['Yes'], $L['No'])), 'USERS_EDIT_TEXT' => cot_textarea('rusertext', $urr['user_text'], 4, 56, array('class' => $editor_class)), 'USERS_EDIT_GENDER' => cot_selectbox_gender($urr['user_gender'], 'rusergender'), 'USERS_EDIT_BIRTHDATE' => cot_selectbox_date(cot_date2stamp($urr['user_birthdate']), 'short', 'ruserbirthdate', cot_date('Y', $sys['now']), cot_date('Y', $sys['now']) - 100, false), 'USERS_EDIT_TIMEZONE' => cot_selectbox_timezone($urr['user_timezone'], 'rusertimezone'), 'USERS_EDIT_REGDATE' => cot_date('datetime_medium', $urr['user_regdate']), 'USERS_EDIT_REGDATE_STAMP' => $urr['user_regdate'], 'USERS_EDIT_LASTLOG' => cot_date('datetime_medium', $urr['user_lastlog']), 'USERS_EDIT_LASTLOG_STAMP' => $urr['user_lastlog'], 'USERS_EDIT_LOGCOUNT' => $urr['user_logcount'], 'USERS_EDIT_LASTIP' => cot_build_ipsearch($urr['user_lastip']), 'USERS_EDIT_DELETE' => $sys['user_istopadmin'] ? cot_radiobox(0, 'ruserdelete', array(1, 0), array($L['Yes'], $L['No'])) . $delete_pfs : $L['na']));
// Extra fields
foreach ($cot_extrafields[$db_users] as $exfld) {
    $tag = strtoupper($exfld['field_name']);
    $t->assign(array('USERS_EDIT_' . $tag => cot_build_extrafields('ruser' . $exfld['field_name'], $exfld, $urr['user_' . $exfld['field_name']]), 'USERS_EDIT_' . $tag . '_TITLE' => isset($L['user_' . $exfld['field_name'] . '_title']) ? $L['user_' . $exfld['field_name'] . '_title'] : $exfld['field_description']));
}
// Error and message reporting
cot_display_messages($t);
/* === Hook === */
foreach (cot_getextplugins('users.edit.tags') as $pl) {
    include $pl;
}
/* ===== */
$t->parse('MAIN');
$t->out('MAIN');
开发者ID:ASDAFF,项目名称:Cotonti,代码行数:31,代码来源:users.edit.php

示例5: cot_inputbox

                        <?php 
echo cot_inputbox('text', 'name', '', array('id' => 'subscribeForm_name'));
?>
                    </div>
                    <div class="form-group">
                        <label><?php 
echo cot::$L['User'];
?>
 (ID)</label>
                        <?php 
echo cot_inputbox('text', 'user', '', array('id' => 'subscribeForm_user'));
?>
                    </div>
                    <div class="checkbox">
                        <?php 
echo cot_checkbox(false, 'active', cot::$L['Enabled'], array('id' => 'subscribeForm_active'));
?>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" id="subscribeFormSubmit" class="btn btn-primary"><?php 
echo cot::$L['Submit'];
?>
</button>
                    <button type="button" class="btn btn-default" data-dismiss="modal"><?php 
echo cot::$L['Close'];
?>
</button>
                </div>
            </form>
        </div>
开发者ID:Alex300,项目名称:subscribe,代码行数:31,代码来源:subscribe.admin.subscriber.list.php

示例6: adv_compare_checkbox

/**
 * Чекбокс "Добавить к сравнению
 *
 * @param advboard_model_Advert $item
 * @param string $title
 * @return string
 */
function adv_compare_checkbox($item, $title = null)
{
    static $loaded = false;
    $choosen = false;
    if ($item instanceof advboard_model_Advert) {
        $id = $item->id;
    } else {
        $id = $item;
    }
    if ($id == 0) {
        return '';
    }
    if (!empty($_SESSION['advboard_compare']) && !empty($_SESSION['advboard_compare'][cot::$sys['site_id']])) {
        if (isset($_SESSION['advboard_compare'][cot::$sys['site_id']][$id]) && !empty($_SESSION['advboard_compare'][cot::$sys['site_id']][$id])) {
            $choosen = true;
        }
    }
    if (is_null($title)) {
        $title = cot::$L['advboard_compare_add'];
    }
    $ret = cot_checkbox($choosen, 'advboard_comp[]', $title, array('class' => 'advboard_compare'), $id, 'input_check');
    if (!$loaded) {
        Resources::linkFileFooter(cot::$cfg["modules_dir"] . '/advboard/js/advboard.compare.form.js');
        $loaded = true;
        $ret .= cot_xp();
    }
    return $ret;
}
开发者ID:ASDAFF,项目名称:advboard,代码行数:35,代码来源:advboard.functions.php

示例7: cot_install_parse_extensions

/**
 * Parses extensions selection section
 *
 * @param string $ext_type Extension type: 'Module' or 'Plugin'
 * @param array $default_list A list of recommended extensions (checked by default)
 * @param array $selected_list A list of previously selected extensions
 */
function cot_install_parse_extensions($ext_type, $default_list = array(), $selected_list = array())
{
    global $t, $cfg, $L;
    $ext_type_lc = strtolower($ext_type);
    $ext_type_uc = strtoupper($ext_type);
    $ext_list = cot_extension_list_info($cfg["{$ext_type_lc}s_dir"]);
    $ext_type_lc == 'plugin' ? uasort($ext_list, 'cot_extension_catcmp') : ksort($ext_list);
    $prev_cat = '';
    $block_name = $ext_type_lc == 'plugin' ? "{$ext_type_uc}_CAT.{$ext_type_uc}_ROW" : "{$ext_type_uc}_ROW";
    foreach ($ext_list as $f => $info) {
        if (is_array($info)) {
            $code = $f;
            if ($ext_type_lc == 'plugin' && $prev_cat != $info['Category']) {
                if ($prev_cat != '') {
                    // Render previous category
                    $t->parse("MAIN.STEP_4.{$ext_type_uc}_CAT");
                }
                // Assign a new one
                $prev_cat = $info['Category'];
                $t->assign('PLUGIN_CAT_TITLE', $L['ext_cat_' . $info['Category']]);
            }
            if (!empty($info['Requires_modules']) || !empty($info['Requires_plugins'])) {
                $modules_list = empty($info['Requires_modules']) ? $L['None'] : implode(', ', explode(',', $info['Requires_modules']));
                $plugins_list = empty($info['Requires_plugins']) ? $L['None'] : implode(', ', explode(',', $info['Requires_plugins']));
                $requires = cot_rc('install_code_requires', array('modules_list' => $modules_list, 'plugins_list' => $plugins_list));
            } else {
                $requires = '';
            }
            if (!empty($info['Recommends_modules']) || !empty($info['Recommends_plugins'])) {
                $modules_list = empty($info['Recommends_modules']) ? $L['None'] : implode(', ', explode(',', $info['Recommends_modules']));
                $plugins_list = empty($info['Recommends_plugins']) ? $L['None'] : implode(', ', explode(',', $info['Recommends_plugins']));
                $recommends = cot_rc('install_code_recommends', array('modules_list' => $modules_list, 'plugins_list' => $plugins_list));
            } else {
                $recommends = '';
            }
            if (count($selected_list) > 0) {
                $checked = in_array($code, $selected_list);
            } else {
                $checked = in_array($code, $default_list);
            }
            $type = $ext_type == 'Module' ? 'module' : 'plug';
            $L['info_name'] = '';
            $L['info_desc'] = '';
            if (file_exists(cot_langfile($code, $type))) {
                include cot_langfile($code, $type);
            }
            $t->assign(array("{$ext_type_uc}_ROW_CHECKBOX" => cot_checkbox($checked, "install_{$ext_type_lc}s[{$code}]"), "{$ext_type_uc}_ROW_TITLE" => empty($L['info_name']) ? $info['Name'] : $L['info_name'], "{$ext_type_uc}_ROW_DESCRIPTION" => empty($L['info_desc']) ? $info['Description'] : $L['info_desc'], "{$ext_type_uc}_ROW_REQUIRES" => $requires, "{$ext_type_uc}_ROW_RECOMMENDS" => $recommends));
            $t->parse("MAIN.STEP_4.{$block_name}");
        }
    }
    if ($ext_type_lc == 'plugin' && $prev_cat != '') {
        // Render last category
        $t->parse("MAIN.STEP_4.{$ext_type_uc}_CAT");
    }
}
开发者ID:Newman101,项目名称:Cotonti,代码行数:62,代码来源:install.install.php

示例8: object_edittags

 public function object_edittags($mavatar, $prefix = "mavatar_")
 {
     global $db_mavatars, $cot_extrafields;
     $curr_mavatar = array('MAVATAR' => $this->object_tags($mavatar), 'ENABLED' => cot_checkbox(true, $prefix . 'enabled[' . $mavatar['id'] . ']', '', 'title="' . $L['Enabled'] . '"'), 'FILEORDER' => cot_inputbox('text', $prefix . 'order[' . $mavatar['id'] . ']', $mavatar['order'], 'maxlength="4" size="4"'), 'FILEDESC' => cot_inputbox('text', $prefix . 'desc[' . $mavatar['id'] . ']', $mavatar['desc']), 'FILEDESCTEXT' => cot_textarea($prefix . 'desc[' . $mavatar['id'] . ']', $mavatar['desc'], 2, 30), 'FILENEW' => cot_inputbox('hidden', $prefix . 'new[' . $mavatar['id'] . ']', 0));
     foreach ($cot_extrafields[$db_mavatars] as $exfld) {
         $uname = strtoupper($exfld['field_name']);
         $exfld_val = cot_build_extrafields($prefix . $exfld['field_name'], $exfld, $mavatar[$exfld['field_name']]);
         $exfld_title = isset($L['mavatar_' . $exfld['field_name'] . '_title']) ? $L['mavatar_' . $exfld['field_name'] . '_title'] : $exfld['field_description'];
         $curr_mavatar[$uname] = $exfld_val;
         $curr_mavatar[$uname . '_TITLE'] = $exfld_title;
     }
     return $curr_mavatar;
 }
开发者ID:bahinn,项目名称:cot-freelance,代码行数:13,代码来源:mavatars.functions.php

示例9: cot_url

$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';
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:pm.send.php

示例10: defined

<?php

/**
 * [BEGIN_COT_EXT]
 * Hooks=users.register.tags
 * [END_COT_EXT]
 */
/**
 * User Agreement plugin
 *
 * @package useragreement
 * @version 1.0
 * @author CMSWorks Team
 * @copyright Copyright (c) CMSWorks.ru, littledev.ru
 * @license BSD
 */
defined('COT_CODE') or die('Wrong URL.');
require_once cot_langfile('useragreement', 'plug');
$t->assign(array("USERS_REGISTER_USERAGREEMENT" => cot_checkbox(0, 'ruseragreement', '') . cot_rc_link(cot_url('plug', 'e=useragreement'), $L['useragreement_agree'], 'target="blank"')));
开发者ID:Andreyjktl,项目名称:cot-freelance,代码行数:19,代码来源:useragreement.users.register.tags.php

示例11: cot_build_extrafields

/**
 * Returns Extra fields edit fields
 *
 * @param string $name Variable name
 * @param array $extrafields Extra fields data
 * @param string $data Existing data for fields
 * @return string
 */
function cot_build_extrafields($name, $extrafield, $data)
{
    global $L, $R, $cfg, $pl;
    $data = $data == null ? $extrafield['field_default'] : $data;
    switch ($extrafield['field_type']) {
        case 'input':
        case 'inputint':
        case 'currency':
        case 'double':
            $result = cot_inputbox('text', $name, $data, '', $extrafield['field_html']);
            break;
        case 'textarea':
            $result = cot_textarea($name, $data, 4, 56, '', $extrafield['field_html']);
            break;
        case 'select':
            $extrafield['field_variants'] = str_replace(array(' , ', ', ', ' ,'), ',', $extrafield['field_variants']);
            $opt_array = explode(",", $extrafield['field_variants']);
            $ii = 0;
            $options_titles = $options_values = array();
            foreach ($opt_array as $var) {
                $ii++;
                $var = trim($var);
                $options_titles[$ii] = !empty($L[$extrafield['field_name'] . '_' . $var]) ? $L[$extrafield['field_name'] . '_' . $var] : $var;
                $options_values[$ii] = $var;
            }
            $result = cot_selectbox(trim($data), $name, $options_values, $options_titles, false, '', $extrafield['field_html']);
            break;
        case 'radio':
            $extrafield['field_variants'] = str_replace(array(' , ', ', ', ' ,'), ',', $extrafield['field_variants']);
            $opt_array = explode(",", $extrafield['field_variants']);
            $options_titles = $options_values = array();
            if (count($opt_array) > 0) {
                $ii = 0;
                foreach ($opt_array as $var) {
                    $ii++;
                    $var = trim($var);
                    $options_titles[$ii] = !empty($L[$extrafield['field_name'] . '_' . $var]) ? $L[$extrafield['field_name'] . '_' . $var] : $var;
                    $options_values[$ii] = $var;
                }
            }
            $result = cot_radiobox(trim($data), $name, $options_values, $options_titles, '', '', $extrafield['field_html']);
            break;
        case 'checkbox':
            $result = cot_checkbox($data, $name, $extrafield['field_description'], '', '1', $extrafield['field_html']);
            break;
        case 'datetime':
            global $sys;
            $extrafield['field_params'] = str_replace(array(' , ', ', ', ' ,'), ',', $extrafield['field_params']);
            list($min, $max, $format) = explode(",", $extrafield['field_params'], 3);
            $max = (int) $max > 0 ? $max : 2030;
            $min = (int) $min > 0 ? $min : 2000;
            $data = mb_substr($data, 0, 1) == "+" ? $sys['now'] + (int) mb_substr($data, 1) : $data;
            $data = mb_substr($data, 0, 1) == "-" ? $sys['now'] - (int) mb_substr($data, 1) : $data;
            $result = cot_selectbox_date((int) $data, 'long', $name, (int) $max, (int) $min, true, $extrafield['field_html']);
            break;
        case 'country':
            global $cot_countries;
            $result = cot_selectbox_countries(trim($data), $name, true, '', $extrafield['field_html']);
            break;
        case 'range':
            $extrafield['field_params'] = str_replace(array(' , ', ', ', ' ,'), ',', $extrafield['field_params']);
            list($min, $max) = explode(',', $extrafield['field_params'], 2);
            $result = cot_selectbox(trim($data), $name, range((int) $min, (int) $max), range((int) $min, (int) $max), true, '', $extrafield['field_html']);
            break;
        case 'checklistbox':
            $extrafield['field_variants'] = str_replace(array(' , ', ', ', ' ,'), ',', $extrafield['field_variants']);
            $opt_array = explode(",", $extrafield['field_variants']);
            $options_titles = $options_values = array();
            if (count($opt_array) > 0) {
                $ii = 0;
                foreach ($opt_array as $var) {
                    $ii++;
                    $var = trim($var);
                    $options_titles[$ii] = !empty($L[$extrafield['field_name'] . '_' . $var]) ? $L[$extrafield['field_name'] . '_' . $var] : $var;
                    $options_values[$ii] = $var;
                }
            }
            if (!is_array($data)) {
                $data = trim(str_replace(array(' , ', ', ', ' ,'), ',', $data));
                $data = explode(',', $data);
            }
            $result = cot_checklistbox($data, $name, $options_values, $options_titles, '', '', true, $extrafield['field_html']);
            break;
        case 'file':
            $extrafield['field_params'] = !empty($extrafield['field_params']) ? $extrafield['field_params'] : $cfg['extrafield_files_dir'];
            $extrafield['field_params'] .= mb_substr($extrafield['field_params'], -1) == '/' ? '' : '/';
            $data_filepath = $extrafield['field_params'] . htmlspecialchars($data);
            /* === Hook === */
            foreach (cot_getextplugins('extrafields.build.file') as $pl) {
                include $pl;
            }
            /* ===== */
//.........这里部分代码省略.........
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:101,代码来源:extrafields.php

示例12: cot_page_status

}
$pag = $row_page;
$pag['page_status'] = cot_page_status($pag['page_state'], $pag['page_begin'], $pag['page_expire']);
cot_block($usr['isadmin'] || $usr['auth_write'] && $usr['id'] == $pag['page_ownerid']);
$out['subtitle'] = $L['page_edittitle'];
$out['head'] .= $R['code_noindex'];
$sys['sublocation'] = $structure['page'][$pag['page_cat']]['title'];
$mskin = cot_tplfile(array('page', 'edit', $structure['page'][$pag['page_cat']]['tpl']));
/* === Hook === */
foreach (cot_getextplugins('page.edit.main') as $pl) {
    include $pl;
}
/* ===== */
require_once $cfg['system_dir'] . '/header.php';
$t = new XTemplate($mskin);
$pageedit_array = array('PAGEEDIT_PAGETITLE' => $L['page_edittitle'], 'PAGEEDIT_SUBTITLE' => $L['page_editsubtitle'], 'PAGEEDIT_FORM_SEND' => cot_url('page', "m=edit&a=update&id=" . $pag['page_id']), 'PAGEEDIT_FORM_ID' => $pag['page_id'], 'PAGEEDIT_FORM_STATE' => $pag['page_state'], 'PAGEEDIT_FORM_STATUS' => $pag['page_status'], 'PAGEEDIT_FORM_LOCALSTATUS' => $L['page_status_' . $pag['page_status']], 'PAGEEDIT_FORM_CAT' => cot_selectbox_structure('page', $pag['page_cat'], 'rpagecat'), 'PAGEEDIT_FORM_CAT_SHORT' => cot_selectbox_structure('page', $pag['page_cat'], 'rpagecat', $c), 'PAGEEDIT_FORM_KEYWORDS' => cot_inputbox('text', 'rpagekeywords', $pag['page_keywords'], array('size' => '32', 'maxlength' => '255')), 'PAGEEDIT_FORM_METATITLE' => cot_inputbox('text', 'rpagemetatitle', $pag['page_metatitle'], array('size' => '64', 'maxlength' => '255')), 'PAGEEDIT_FORM_METADESC' => cot_textarea('rpagemetadesc', $pag['page_metadesc'], 2, 64, array('maxlength' => '255')), 'PAGEEDIT_FORM_ALIAS' => cot_inputbox('text', 'rpagealias', $pag['page_alias'], array('size' => '32', 'maxlength' => '255')), 'PAGEEDIT_FORM_TITLE' => cot_inputbox('text', 'rpagetitle', $pag['page_title'], array('size' => '64', 'maxlength' => '255')), 'PAGEEDIT_FORM_DESC' => cot_textarea('rpagedesc', $pag['page_desc'], 2, 64, array('maxlength' => '255')), 'PAGEEDIT_FORM_AUTHOR' => cot_inputbox('text', 'rpageauthor', $pag['page_author'], array('size' => '24', 'maxlength' => '100')), 'PAGEEDIT_FORM_DATE' => cot_selectbox_date($pag['page_date'], 'long', 'rpagedate') . ' ' . $usr['timetext'], 'PAGEEDIT_FORM_DATENOW' => cot_checkbox(0, 'rpagedatenow'), 'PAGEEDIT_FORM_BEGIN' => cot_selectbox_date($pag['page_begin'], 'long', 'rpagebegin') . ' ' . $usr['timetext'], 'PAGEEDIT_FORM_EXPIRE' => cot_selectbox_date($pag['page_expire'], 'long', 'rpageexpire') . ' ' . $usr['timetext'], 'PAGEEDIT_FORM_UPDATED' => cot_date('datetime_full', $pag['page_updated']) . ' ' . $usr['timetext'], 'PAGEEDIT_FORM_FILE' => cot_selectbox($pag['page_file'], 'rpagefile', range(0, 2), array($L['No'], $L['Yes'], $L['Members_only']), false), 'PAGEEDIT_FORM_URL' => cot_inputbox('text', 'rpageurl', $pag['page_url'], array('size' => '56', 'maxlength' => '255')), 'PAGEEDIT_FORM_SIZE' => cot_inputbox('text', 'rpagesize', $pag['page_size'], array('size' => '56', 'maxlength' => '255')), 'PAGEEDIT_FORM_TEXT' => cot_textarea('rpagetext', $pag['page_text'], 24, 120, '', 'input_textarea_editor'), 'PAGEEDIT_FORM_DELETE' => cot_radiobox(0, 'rpagedelete', array(1, 0), array($L['Yes'], $L['No'])), 'PAGEEDIT_FORM_PARSER' => cot_selectbox($pag['page_parser'], 'rpageparser', cot_get_parsers(), cot_get_parsers(), false));
if ($usr['isadmin']) {
    $pageedit_array += array('PAGEEDIT_FORM_OWNERID' => cot_inputbox('text', 'rpageownerid', $pag['page_ownerid'], array('size' => '24', 'maxlength' => '24')), 'PAGEEDIT_FORM_PAGECOUNT' => cot_inputbox('text', 'rpagecount', $pag['page_count'], array('size' => '8', 'maxlength' => '8')), 'PAGEEDIT_FORM_FILECOUNT' => cot_inputbox('text', 'rpagefilecount', $pag['page_filecount'], array('size' => '8', 'maxlength' => '8')));
}
$t->assign($pageedit_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, $pag['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('PAGEEDIT_FORM_' . $uname => $exfld_val, 'PAGEEDIT_FORM_' . $uname . '_TITLE' => $exfld_title, 'PAGEEDIT_FORM_EXTRAFLD' => $exfld_val, 'PAGEEDIT_FORM_EXTRAFLD_TITLE' => $exfld_title));
    $t->parse('MAIN.EXTRAFLD');
}
// Error and message handling
cot_display_messages($t);
/* === Hook === */
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:page.edit.php

示例13: cot_getextplugins

/* === Hook - Part1 : Set === */
$extp = cot_getextplugins('bbcode.admin.loop');
/* ===== */
foreach ($res->fetchAll() as $row) {
    $id = $row['bbc_id'];
    $bb_t->assign(array('ADMIN_BBCODE_ROW_ID' => $row['bbc_id'], 'ADMIN_BBCODE_ROW_TITLE' => $row['bbc_name'], 'ADMIN_BBCODE_ROW_NAME' => cot_inputbox('text', 'bbca_name[' . $id . ']', $row['bbc_name']), 'ADMIN_BBCODE_ROW_ENABLED' => cot_checkbox($row['bbc_enabled'], 'bbca_enabled[' . $id . ']'), 'ADMIN_BBCODE_ROW_CONTAINER' => cot_checkbox($row['bbc_container'], 'bbca_container[' . $id . ']'), 'ADMIN_BBCODE_ROW_PATTERN' => cot_textarea('bbca_pattern[' . $id . ']', $row['bbc_pattern'], 2, 20), 'ADMIN_BBCODE_ROW_REPLACEMENT' => cot_textarea('bbca_replacement[' . $id . ']', $row['bbc_replacement'], 2, 20), 'ADMIN_BBCODE_ROW_PLUG' => $row['bbc_plug'], 'ADMIN_BBCODE_ROW_MODE' => cot_selectbox($row['bbc_mode'], 'bbca_mode[' . $id . ']', $bbc_modes, $bbc_modes, false), 'ADMIN_BBCODE_ROW_PRIO' => cot_selectbox($row['bbc_priority'], 'bbca_priority[' . $id . ']', range(1, 256), range(1, 256), false), 'ADMIN_BBCODE_ROW_POSTRENDER' => cot_checkbox($row['bbc_postrender'], 'bbca_postrender[' . $id . ']'), 'ADMIN_BBCODE_ROW_DELETE_URL' => cot_url('admin', 'm=other&p=bbcode&a=del&id=' . $id . '&d=' . $durl), 'ADMIN_BBCODE_ROW_ODDEVEN' => cot_build_oddeven($ii)));
    /* === Hook - Part2 : Include === */
    foreach ($extp as $pl) {
        include $pl;
    }
    /* ===== */
    $bb_t->parse('MAIN.ADMIN_BBCODE_ROW');
    $ii++;
}
$res->closeCursor();
$bb_t->assign(array('ADMIN_BBCODE_PAGINATION_PREV' => $pagenav['prev'], 'ADMIN_BBCODE_PAGNAV' => $pagenav['main'], 'ADMIN_BBCODE_PAGINATION_NEXT' => $pagenav['next'], 'ADMIN_BBCODE_TOTALITEMS' => $totalitems, 'ADMIN_BBCODE_COUNTER_ROW' => $ii, 'ADMIN_BBCODE_FORM_ACTION' => cot_url('admin', 'm=other&p=bbcode&a=add&d=' . $durl), 'ADMIN_BBCODE_NAME' => cot_inputbox('text', 'bbc_name', $bbc['name']), 'ADMIN_BBCODE_ENABLED' => cot_checkbox($bbc['enabled'], 'bbc_enabled'), 'ADMIN_BBCODE_CONTAINER' => cot_checkbox($bbc['container'], 'bbc_container'), 'ADMIN_BBCODE_PATTERN' => cot_textarea('bbc_pattern', $bbc['pattern'], 2, 20), 'ADMIN_BBCODE_REPLACEMENT' => cot_textarea('bbc_replacement', $bbc['replacement'], 2, 20), 'ADMIN_BBCODE_MODE' => cot_selectbox(!empty($bbc['mode']) ? $bbc['mode'] : 'pcre', 'bbc_mode', $bbc_modes, $bbc_modes, false), 'ADMIN_BBCODE_PRIO' => cot_selectbox(is_numeric($bbc['priority']) ? $bbc['priority'] : '128', 'bbc_priority', range(1, 256), range(1, 256), false), 'ADMIN_BBCODE_POSTRENDER' => cot_checkbox($bbc['postrender'], 'bbc_postrender'), 'ADMIN_BBCODE_URL_CLEAR_CACHE' => cot_url('admin', 'm=other&p=bbcode&a=clearcache&d=' . $durl), 'ADMIN_BBCODE_UPDATE_URL' => cot_url('admin', 'm=other&p=bbcode&a=upd&d=' . $durl)));
// HTML conversion links
if (cot_module_active('page')) {
    $bb_t->assign(array('ADMIN_BBCODE_CONVERT_URL' => cot_url('admin', 'm=other&p=bbcode&a=convert&b=page'), 'ADMIN_BBCODE_CONVERT_TITLE' => $L['adm_bbcodes_convert_page']));
    $bb_t->parse('MAIN.ADMIN_BBCODE_CONVERT');
}
if (cot_module_active('forums')) {
    $bb_t->assign(array('ADMIN_BBCODE_CONVERT_URL' => cot_url('admin', 'm=other&p=bbcode&a=convert&b=forums'), 'ADMIN_BBCODE_CONVERT_TITLE' => $L['adm_bbcodes_convert_forums']));
    $bb_t->parse('MAIN.ADMIN_BBCODE_CONVERT');
}
if (cot_plugin_active('comments')) {
    $bb_t->assign(array('ADMIN_BBCODE_CONVERT_URL' => cot_url('admin', 'm=other&p=bbcode&a=convert&b=comments'), 'ADMIN_BBCODE_CONVERT_TITLE' => $L['adm_bbcodes_convert_comments']));
    $bb_t->parse('MAIN.ADMIN_BBCODE_CONVERT');
}
if (cot_module_active('pm')) {
    $bb_t->assign(array('ADMIN_BBCODE_CONVERT_URL' => cot_url('admin', 'm=other&p=bbcode&a=convert&b=pm'), 'ADMIN_BBCODE_CONVERT_TITLE' => $L['adm_bbcodes_convert_pm']));
开发者ID:Andreyjktl,项目名称:Cotonti,代码行数:31,代码来源:bbcode.admin.php

示例14: defined

 * @license BSD
 *  */
defined('COT_CODE') or die('Wrong URL.');
require_once cot_langfile('usergroupselector', 'plug');
$prfx = 'USERS_REGISTER_';
if ($m == 'edit') {
    $prfx = 'USERS_EDIT_';
} elseif ($m == 'profile') {
    $prfx = 'USERS_PROFILE_';
}
if (($cfg['plugin']['usergroupselector']['allowchange'] || $cfg['plugin']['usergroupselector']['required']) && $urr['user_maingrp'] != COT_GROUP_SUPERADMINS && $urr['user_maingrp'] != COT_GROUP_MODERATORS) {
    $options = explode(',', $cfg['plugin']['usergroupselector']['groups']);
    $groups_values = array();
    $groups_titles = array();
    foreach ($options as $v) {
        $groups_values[] = $v;
        $groups_titles[] = $cot_groups[$v]['title'];
        if ($usergroup == $cot_groups[$v]['alias']) {
            $usergroupid = $v;
        }
        $t->assign(array('USERGROUP_ROW_ID' => $v, 'USERGROUP_ROW_TITLE' => $cot_groups[$v]['title'], 'USERGROUP_ROW_ALIAS' => $cot_groups[$v]['alias'], 'USERGROUP_ROW_ACTIVEID' => $usergroup == $cot_groups[$v]['alias'] ? true : false));
        $t->parse('MAIN.USERGROUP_ROW');
    }
    if (count($groups_values) == 1) {
        $user_f_group = cot_checkbox($urr['user_usergroup'], 'ruserusergroup', $groups_titles[0], '', $groups_values[0]);
    } else {
        $user_f_group = cot_radiobox($urr['user_usergroup'], 'ruserusergroup', $groups_values, $groups_titles, '', '<br />');
    }
    $t->assign($prfx . 'GROUPSELECT', $user_f_group);
    $t->assign($prfx . 'GROUPSELECTBOX', cot_selectbox($urr['user_usergroup'], 'ruserusergroup', $groups_values, $groups_titles));
}
开发者ID:Andreyjktl,项目名称:cot-freelance,代码行数:31,代码来源:usergroupselector.edit.tags.php

示例15: editAction


//.........这里部分代码省略.........
     $placeHolder_Phone = '';
     $placeHolder_Email = '';
     $placeHolder_City = '';
     //if($advboard->user == cot::$usr['id'] && cot::$usr['id'] > 0) {
     if (!empty($user)) {
         // Контакное лицо
         $placeHolder_Person = cot_user_full_name($user);
         // Телефон
         if (!empty($user['user_phone'])) {
             $placeHolder_Phone = $user['user_phone'];
         }
         // email
         if (!$user['user_hideemail']) {
             $placeHolder_Email = $user['user_email'];
         }
         // город
         if (!empty($user['user_city_name'])) {
             $placeHolder_City = $user['user_city_name'];
         }
     }
     // 'input_textarea_editor', 'input_textarea_medieditor', 'input_textarea_minieditor', ''
     $editor = 'input_textarea_editor';
     /* === Hook === */
     foreach (cot_getextplugins('advboard.edit.main') as $pl) {
         include $pl;
     }
     /* ===== */
     $minYear = date('Y');
     $maxYear = $minYear + 30;
     $price = $advert->rawValue('price');
     if ($price <= 0) {
         $price = '';
     }
     $formElements = array('hidden' => array('element' => cot_inputbox('hidden', 'act', 'save')), 'category' => array('element' => cot_selectbox_structure('advboard', $advert->category, 'category'), 'label' => advboard_model_Advert::fieldLabel('category')), 'price' => array('element' => cot_inputbox('text', 'price', $price), 'label' => advboard_model_Advert::fieldLabel('price'), 'hint' => cot::$L['advboard_price_hint']), 'title' => array('element' => cot_inputbox('text', 'title', $advert->rawValue('title')), 'required' => true, 'label' => advboard_model_Advert::fieldLabel('title')), 'description' => array('element' => cot_inputbox('text', 'description', $advert->rawValue('description')), 'label' => advboard_model_Advert::fieldLabel('description')), 'text' => array('element' => cot_textarea('text', $advert->rawValue('text'), 5, 120, '', $editor), 'label' => advboard_model_Advert::fieldLabel('text')), 'person' => array('element' => cot_inputbox('text', 'person', $advert->rawValue('person'), array('class' => 'form-control', 'placeholder' => $placeHolder_Person)), 'label' => advboard_model_Advert::fieldLabel('person'), 'required' => cot::$usr['id'] == 0), 'email' => array('element' => cot_inputbox('text', 'email', $advert->rawValue('email'), array('class' => 'form-control', 'placeholder' => $placeHolder_Email)), 'label' => advboard_model_Advert::fieldLabel('email')), 'city' => array('element' => cot_inputbox('text', 'city_name', $advert->rawValue('city_name'), array('class' => 'form-control', 'placeholder' => $placeHolder_City)), 'label' => advboard_model_Advert::fieldLabel('city_name'), 'required' => $category['config']['city_require']), 'phone' => array('element' => cot_inputbox('text', 'phone', $advert->rawValue('phone'), array('class' => 'form-control', 'placeholder' => $placeHolder_Phone)), 'label' => advboard_model_Advert::fieldLabel('phone'), 'required' => $category['config']['phone_require']), 'sticky' => array('element' => cot_checkbox($advert->sticky, 'sticky', advboard_model_Advert::fieldLabel('sticky')), 'label' => advboard_model_Advert::fieldLabel('sticky')), 'published' => array('element' => cot_checkbox($published, 'published', cot::$L['advboard_published'] . '?'), 'label' => cot::$L['advboard_published'] . '?'), 'begin' => array('element' => cot_selectbox_date($advert->begin, 'long', 'begin', $maxYear, $minYear), 'label' => advboard_model_Advert::fieldLabel('begin')), 'expire' => array('element' => cot_selectbox_date($advert->expire, 'long', 'expire', $maxYear, $minYear), 'label' => advboard_model_Advert::fieldLabel('expire')), 'sort' => array('element' => cot_selectbox_date($advert->sort, 'long', 'sort', $maxYear, $minYear), 'label' => advboard_model_Advert::fieldLabel('sort')), 'period' => array('element' => cot_selectbox('', 'period', $periodItems, array(), false), 'label' => cot::$L['advboard_period']));
     if (!empty($cot_extrafields[cot::$db->advboard])) {
         // Extra fields for ads
         foreach ($cot_extrafields[cot::$db->advboard] as $exfld) {
             $fName = $exfld['field_name'];
             $formElements[$fName] = array('element' => cot_build_extrafields($fName, $exfld, $advert->rawValue($fName)));
             if ($exfld['field_type'] !== 'checkbox') {
                 $formElements[$fName]['label'] = isset(cot::$L['advboard_' . $exfld['field_name'] . '_title']) ? cot::$L['advboard_' . $exfld['field_name'] . '_title'] : advboard_model_Advert::fieldLabel($fName);
             }
         }
     }
     if (cot_plugin_active('regioncity')) {
         $formElements['city']['element'] = rec_select2_city('city', $advert->rawValue('city'), true, array('class' => 'form-control', 'placeholder' => $placeHolder_City));
     }
     if ($category['config']['city_require']) {
         $formElements['city']['required'] = true;
     }
     if ($category['config']['phone_require']) {
         $formElements['phone']['required'] = true;
     }
     // Hints
     if (!empty($user)) {
         // Контакное лицо
         $formElements['person']['hint'] = cot::$L['advboard_leave_empty_to_use'] . ": " . cot_user_full_name($user);
         // Телефон
         if (!empty($user['user_phone'])) {
             $formElements['phone']['hint'] = cot::$L['advboard_leave_empty_to_use'] . ": " . $user['user_phone'];
         }
         // email
         if (!$user['user_hideemail']) {
             $formElements['email']['hint'] = cot::$L['advboard_leave_empty_to_use'] . ": " . $user['user_email'];
         }
         // город
开发者ID:ASDAFF,项目名称:advboard,代码行数:67,代码来源:Main.php


注:本文中的cot_checkbox函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。