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


PHP cmsForm::getFieldsHtml方法代码示例

本文整理汇总了PHP中cmsForm::getFieldsHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsForm::getFieldsHtml方法的具体用法?PHP cmsForm::getFieldsHtml怎么用?PHP cmsForm::getFieldsHtml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cmsForm的用法示例。


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

示例1: users


//.........这里部分代码省略.........
        $pagebar_link = '/users/' . $link['selected'] . '%page%.html';
        if ($group_id) {
            $link['selected'] = 'group';
            $pagebar_link = '/users/' . $link['selected'] . '/' . $group_id . '-%page%';
        }
        cmsPage::initTemplate('components', 'com_users_view')->assign('stext', $stext)->assign('orderby', $orderby)->assign('orderto', $orderto)->assign('users', $users)->assign('total', $total)->assign('only_online', $only_online)->assign('gender', $gender)->assign('name', stripslashes($name))->assign('city', stripslashes($city))->assign('hobby', stripslashes($hobby))->assign('age_to', $age_to)->assign('age_fr', $age_fr)->assign('cfg', $model->config)->assign('link', $link)->assign('pagebar', cmsPage::getPagebar($total, $page, $model->config['users_perpage'], $pagebar_link))->display('com_users_view.tpl');
    }
    //============================================================================//
    //======================= Редактирование профиля  ============================//
    //============================================================================//
    if ($do == 'editprofile') {
        // неавторизованным, не владельцам и не админам тут делать нечего
        if (!$inUser->id || $inUser->id != $id && !$inUser->is_admin) {
            cmsCore::error404();
        }
        $usr = $model->getUser($id);
        if (!$usr) {
            cmsCore::error404();
        }
        $opt = cmsCore::request('opt', 'str', 'edit');
        // главного админа может редактировать только он сам
        if ($id == 1 && $inUser->id != $id) {
            cmsCore::error404();
        }
        // показываем форму
        if ($opt == 'edit') {
            $inPage->setTitle($_LANG['CONFIG_PROFILE'] . ' - ' . $usr['nickname']);
            $inPage->addPathway($usr['nickname'], cmsUser::getProfileURL($usr['login']));
            $inPage->addPathway($_LANG['CONFIG_PROFILE']);
            $private_forms = array();
            if (isset($model->config['privforms'])) {
                if (is_array($model->config['privforms'])) {
                    foreach ($model->config['privforms'] as $form_id) {
                        $private_forms = array_merge($private_forms, cmsForm::getFieldsHtml($form_id, $usr['formsdata']));
                    }
                }
            }
            cmsPage::initTemplate('components', 'com_users_edit_profile')->assign('opt', $opt)->assign('usr', $usr)->assign('private_forms', $private_forms)->assign('cfg_forum', $inCore->loadComponentConfig('forum'))->assign('cfg', $model->config)->display('com_users_edit_profile.tpl');
            return;
        }
        // Если сохраняем профиль
        if ($opt == 'save') {
            if (!cmsUser::checkCsrfToken()) {
                cmsCore::error404();
            }
            $errors = false;
            $users['nickname'] = cmsCore::request('nickname', 'str');
            if (mb_strlen($users['nickname']) < 2) {
                cmsCore::addSessionMessage($_LANG['SHORT_NICKNAME'], 'error');
                $errors = true;
            }
            cmsCore::loadModel('registration');
            $modreg = new cms_model_registration();
            if (!$inUser->is_admin) {
                if ($modreg->getBadNickname($users['nickname'])) {
                    cmsCore::addSessionMessage($_LANG['ERR_NICK_EXISTS'], 'error');
                    $errors = true;
                }
            }
            $profiles['gender'] = cmsCore::request('gender', 'str');
            $profiles['city'] = cmsCore::request('city', 'str');
            if (mb_strlen($profiles['city']) > 50) {
                cmsCore::addSessionMessage($_LANG['LONG_CITY_NAME'], 'error');
                $errors = true;
            }
            $users['email'] = cmsCore::request('email', 'email');
开发者ID:deltas1,项目名称:icms1,代码行数:67,代码来源:frontend.php

示例2: board


//.........这里部分代码省略.........
    cmsCore::c('page')->addPathway($item['title']);

    $pagetitle = $item['pagetitle'] ? $item['pagetitle'] : $item['title'];
    $pagekeys  = $item['meta_keys'] ? $item['meta_keys'] : $item['title'];
    $pagedesc  = $item['meta_desc'] ? $item['meta_desc'] : $item['content'];

    cmsCore::c('page')->setTitle($pagetitle);
    cmsCore::c('page')->setDescription(crop($pagedesc));
    cmsCore::c('page')->setKeywords($pagekeys);

    cmsPage::initTemplate('components', 'com_board_item')->
        assign('item', $item)->
        assign('cfg', cmsCore::m('board')->config)->
        assign('user_id', cmsCore::c('user')->id)->
        assign('is_admin', cmsCore::c('user')->is_admin)->
        assign('formsdata', cmsForm::getFieldsValues($item['form_id'], $item['form_array']))->
        assign('is_moder', cmsCore::m('board')->is_moderator_by_group)->
        display();
}

/////////////////////////////// NEW BOARD ITEM /////////////////////////////////
if ($do == 'additem') {
    // Получаем категории, в которые может загружать пользователь
    $catslist = cmsCore::m('board')->getPublicCats(cmsCore::m('board')->category_id);
    if (!$catslist) {
        cmsCore::addSessionMessage($_LANG['YOU_CANT_ADD_ADV_ANY'], 'error');
        $inCore->redirect('/board');
    }

    $cat['is_photos'] = 1;
    $formsdata = array();
    if (cmsCore::m('board')->category_id && cmsCore::m('board')->category_id != cmsCore::m('board')->root_cat['id']) {
        $cat = cmsCore::m('board')->getCategory(cmsCore::m('board')->category_id);
        $formsdata = cmsForm::getFieldsHtml($cat['form_id']);
    }

    cmsCore::c('page')->addPathway($_LANG['ADD_ADV']);

    if ( !cmsCore::inRequest('submit') ) {
        if (IS_BILLING) { cmsBilling::checkBalance('board', 'add_item'); }
        cmsCore::c('page')->setTitle($_LANG['ADD_ADV']);

        $item = cmsUser::sessionGet('item');
        if ($item) { cmsUser::sessionDel('item'); }

        $item['city'] = !empty($item['city']) ? $item['city'] : cmsCore::c('user')->city;

        cmsPage::initTemplate('components', 'com_board_edit')->
            assign('action', "/board/add.html")->
            assign('form_do', 'add')->
            assign('cfg', cmsCore::m('board')->config)->
            assign('cat', $cat)->
            assign('item', $item)->
            assign('pagetitle', $_LANG['ADD_ADV'])->
            assign('formsdata', $formsdata)->
            assign('is_admin', cmsCore::c('user')->is_admin)->
            assign('is_user', cmsCore::c('user')->id)->
            assign('catslist', $catslist)->
            assign('is_billing', IS_BILLING)->assign('balance', cmsCore::c('user')->balance)->
            display();

        cmsUser::sessionClearAll();

        return;
    }
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:66,代码来源:frontend.php

示例3: registration


//.........这里部分代码省略.........
        $pagetitle = $inCore->getComponentTitle();
        $inPage->setTitle($pagetitle);
        $inPage->addPathway($pagetitle);
        $inPage->addHeadJsLang(array('WRONG_PASS'));
        // Если пользователь авторизован, то не показываем форму регистрации, редирект в профиль.
        if ($inUser->id && !$inUser->is_admin) {
            if ($inCore->menuId() == 1) {
                return;
            } else {
                cmsCore::redirect(cmsUser::getProfileURL($inUser->login));
            }
        }
        $correct_invite = cmsUser::sessionGet('invite_code') ? true : false;
        if ($model->config['reg_type'] == 'invite' && cmsCore::inRequest('invite_code')) {
            $invite_code = cmsCore::request('invite_code', 'str', '');
            $correct_invite = $users_model->checkInvite($invite_code);
            if ($correct_invite) {
                cmsUser::sessionPut('invite_code', $invite_code);
            } else {
                cmsCore::addSessionMessage($_LANG['INCORRECT_INVITE'], 'error');
            }
        }
        $item = cmsUser::sessionGet('item');
        if ($item) {
            cmsUser::sessionDel('item');
        }
        if (empty($item['birthdate'])) {
            $item['birthdate'] = date('Y-m-d');
        }
        $private_forms = array();
        if (isset($users_model->config['privforms'])) {
            if (is_array($users_model->config['privforms'])) {
                foreach ($users_model->config['privforms'] as $form_id) {
                    $private_forms = array_merge($private_forms, cmsForm::getFieldsHtml($form_id, array(), true));
                }
            }
        }
        cmsPage::initTemplate('components', 'com_registration')->assign('cfg', $model->config)->assign('item', $item)->assign('pagetitle', $pagetitle)->assign('correct_invite', $correct_invite)->assign('private_forms', $private_forms)->display('com_registration.tpl');
    }
    //============================================================================//
    if ($do == 'activate') {
        $code = cmsCore::request('code', 'str', '');
        if (!$code) {
            cmsCore::error404();
        }
        $user_id = $inDB->get_field('cms_users_activate', "code = '{$code}'", 'user_id');
        if (!$user_id) {
            cmsCore::error404();
        }
        $inDB->query("UPDATE cms_users SET is_locked = 0 WHERE id = '{$user_id}'");
        $inDB->query("DELETE FROM cms_users_activate WHERE code = '{$code}'");
        cmsCore::callEvent('USER_ACTIVATED', $user_id);
        if ($model->config['send_greetmsg']) {
            $model->sendGreetsMessage($user_id);
        }
        // Регистрируем событие
        cmsActions::log('add_user', array('object' => '', 'user_id' => $user_id, 'object_url' => '', 'object_id' => $user_id, 'target' => '', 'target_url' => '', 'target_id' => 0, 'description' => ''));
        cmsCore::addSessionMessage($_LANG['ACTIVATION_COMPLETE'], 'info');
        cmsUser::goToLogin();
    }
    //============================================================================//
    if ($do == 'auth') {
        //====================//
        //==  разлогивание  ==//
        if (cmsCore::inRequest('logout')) {
            $inUser->logout();
开发者ID:vicktorwork,项目名称:cms1,代码行数:67,代码来源:frontend.php

示例4: cms_model_board

$model = new cms_model_board();
$cat_id = cmsCore::request('value', 'int', 0);
$cat = $model->getCategory($cat_id);
if (!$cat) {
    echo 1;
    exit;
}
if (!$model->checkLoadedByUser24h($cat)) {
    echo 1;
    exit;
}
if (!$model->checkAdd($cat)) {
    echo 1;
    exit;
}
$forms = cmsForm::getFieldsHtml($cat['form_id']);
if (!$forms) {
    echo 1;
    exit;
}
$html = '';
foreach ($forms as $form) {
    $html .= '<tr class="cat_form">
			<td valign="top">
				<span>' . $form['title'] . ':</span>';
    if ($form['description']) {
        $html .= '<div style="color:gray">' . $form['description'] . '</div>';
    }
    $html .= '</td>
			<td valign="top">
				' . $form['field'] . '
开发者ID:4uva4ek,项目名称:svato,代码行数:31,代码来源:get_form.php


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