本文整理汇总了PHP中cmsTemplate类的典型用法代码示例。如果您正苦于以下问题:PHP cmsTemplate类的具体用法?PHP cmsTemplate怎么用?PHP cmsTemplate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了cmsTemplate类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: run
public function run($template_name)
{
$template = new cmsTemplate($template_name);
if (!$template->hasOptions()) {
cmsCore::error404();
}
$form = $template->getOptionsForm();
// Форма отправлена?
$is_submitted = $this->request->has('submit');
$options = $template->getOptions();
if ($is_submitted) {
// Парсим форму и получаем поля записи
$options = $form->parse($this->request, $is_submitted, $options);
// Проверям правильность заполнения
$errors = $form->validate($this, $options);
if (!$errors) {
$template->saveOptions($options);
$this->redirectBack('settings');
}
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
}
return cmsTemplate::getInstance()->render('settings_theme', array('template_name' => $template_name, 'options' => $options, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
开发者ID:asphix,项目名称:icms2,代码行数:25,代码来源:settings_theme.php
示例2: run
public function run($template_name)
{
$template = new cmsTemplate($template_name);
if (!$template->hasOptions()) {
cmsCore::error404();
}
$form = $template->getOptionsForm();
$options = $template->getOptions();
if ($this->request->has('submit')) {
// Парсим форму и получаем поля записи
$options = $form->parse($this->request, true, $options);
// Проверям правильность заполнения
$errors = $form->validate($this, $options);
if (!$errors) {
if ($template->saveOptions($options)) {
cmsUser::addSessionMessage(LANG_CP_SAVE_SUCCESS, 'success');
} else {
cmsUser::addSessionMessage(LANG_CP_SETTINGS_TPL_NOT_WRITABLE, 'error');
}
$this->redirectToAction('settings');
}
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
}
return $this->cms_template->render('settings_theme', array('template_name' => $template_name, 'options' => $options, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
开发者ID:Val-Git,项目名称:icms2,代码行数:27,代码来源:settings_theme.php
示例3: run
public function run($id)
{
if (!$id) {
cmsCore::error404();
}
$form = $this->getForm('preset', array('edit'));
$is_submitted = $this->request->has('submit');
$preset = $original_preset = $this->model->getPreset($id);
if ($preset['is_internal']) {
$form->removeFieldset('basic');
}
if ($is_submitted) {
$preset = $form->parse($this->request, $is_submitted);
$errors = $form->validate($this, $preset);
if (!$errors) {
$this->model->updatePreset($id, $preset);
$this->createDefaultImages(array_merge($original_preset, $preset));
$this->redirectToAction('presets');
}
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
}
return cmsTemplate::getInstance()->render('backend/preset', array('do' => 'edit', 'preset' => $preset, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
开发者ID:pin-git,项目名称:icms2,代码行数:25,代码来源:presets_edit.php
示例4: run
public function run($tag_id)
{
if (!$tag_id) {
cmsCore::error404();
}
$tags_model = cmsCore::getModel('tags');
$form = $this->getForm('tag');
$is_submitted = $this->request->has('submit');
$tag = $tags_model->getTag($tag_id);
$original_tag = $tag['tag'];
if ($is_submitted) {
$tag = $form->parse($this->request, $is_submitted);
$errors = $form->validate($this, $tag);
if ($original_tag == $tag['tag']) {
$this->redirectToAction();
}
if (!$errors) {
$duplicate_id = $tags_model->getTagId($tag['tag']);
if (!$duplicate_id) {
$tags_model->updateTag($tag_id, $tag);
}
if ($duplicate_id) {
$tags_model->mergeTags($tag_id, $duplicate_id);
cmsUser::addSessionMessage(sprintf(LANG_TAGS_MERGED, $original_tag, $tag['tag']), 'success');
}
$this->redirectToAction();
}
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
}
return cmsTemplate::getInstance()->render('backend/tag', array('do' => 'edit', 'tag' => $tag, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
开发者ID:asphix,项目名称:icms2,代码行数:33,代码来源:edit.php
示例5: run
public function run($ctype_id)
{
if (!$ctype_id) {
cmsCore::error404();
}
$content_model = cmsCore::getModel('content');
$ctype = $content_model->getContentType($ctype_id);
if (!$ctype) {
cmsCore::error404();
}
$form = $this->getForm('ctypes_dataset', array('add', $ctype['id']));
$is_submitted = $this->request->has('submit');
$fields = $content_model->getContentFields($ctype['name']);
$dataset = array('sorting' => array(array('by' => 'date_pub', 'to' => 'desc')));
if ($is_submitted) {
$dataset = $form->parse($this->request, $is_submitted);
$dataset['filters'] = $this->request->get('filters');
$dataset['sorting'] = $this->request->get('sorting');
$errors = $form->validate($this, $dataset);
if (!$errors) {
$dataset_id = $content_model->addContentDataset($dataset, $ctype);
if ($dataset_id) {
cmsUser::addSessionMessage(sprintf(LANG_CP_DATASET_CREATED, $dataset['title']), 'success');
}
$this->redirectToAction('ctypes', array('datasets', $ctype['id']));
}
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
}
return cmsTemplate::getInstance()->render('ctypes_dataset', array('do' => 'add', 'ctype' => $ctype, 'dataset' => $dataset, 'fields' => $fields, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
开发者ID:pin-git,项目名称:icms2,代码行数:32,代码来源:ctypes_datasets_add.php
示例6: run
public function run()
{
if (!$this->request->isAjax()) {
cmsCore::error404();
}
$template = cmsTemplate::getInstance();
$entry_id = $this->request->get('id');
// Проверяем валидность
$is_valid = is_numeric($entry_id);
if (!$is_valid) {
$result = array('error' => true, 'message' => LANG_ERROR);
$template->renderJSON($result);
}
$user = cmsUser::getInstance();
$entry = $this->model->getEntry($entry_id);
$replies = $this->model->getReplies($entry_id);
if (!$replies) {
$result = array('error' => true, 'message' => LANG_ERROR);
$template->renderJSON($result);
}
$permissions = array('add' => $user->is_logged, 'delete' => $user->is_admin || $user->id == $entry['profile_id']);
$html = $template->renderInternal($this, 'entry', array('entries' => $replies, 'user' => $user, 'permissions' => $permissions));
// Формируем и возвращаем результат
$result = array('error' => false, 'html' => $html);
$template->renderJSON($result);
}
开发者ID:asphix,项目名称:icms2,代码行数:26,代码来源:get_replies.php
示例7: run
public function run($id)
{
if (!$id) {
cmsCore::error404();
}
$users_model = cmsCore::getModel('users');
$group = $users_model->getGroup($id);
if (!$group) {
cmsCore::error404();
}
$controllers = cmsPermissions::getControllersWithRules();
$owners = array();
foreach ($controllers as $controller_name) {
$controller = cmsCore::getController($controller_name);
$subjects = $controller->getPermissionsSubjects();
$rules = cmsPermissions::getRulesList($controller_name);
$values = array();
foreach ($subjects as $subject) {
$values[$subject['name']] = cmsPermissions::getPermissions($subject['name']);
}
$owners[$controller_name] = array('subjects' => $subjects, 'rules' => $rules, 'values' => $values);
}
$template = cmsTemplate::getInstance();
$template->setMenuItems('users_group', array(array('title' => LANG_CONFIG, 'url' => href_to($this->name, 'users', array('group_edit', $id))), array('title' => LANG_PERMISSIONS, 'url' => href_to($this->name, 'users', array('group_perms', $id)))));
return $template->render('users_group_perms', array('group' => $group, 'owners' => $owners));
}
开发者ID:asphix,项目名称:icms2,代码行数:26,代码来源:users_group_perms.php
示例8: run
public function run($id = false)
{
if (!$id) {
cmsCore::error404();
}
$widgets_model = cmsCore::getModel('widgets');
cmsCore::loadAllControllersLanguages();
$page = $widgets_model->getPage($id);
if (!$page) {
cmsCore::error404();
}
$form = $this->getForm('widgets_page');
if (!$page['is_custom']) {
$form->removeField('title', 'title');
}
$is_submitted = $this->request->has('submit');
if ($is_submitted) {
$page = $form->parse($this->request, $is_submitted);
$errors = $form->validate($this, $page);
if (!$errors) {
$widgets_model->updatePage($id, $page);
$this->redirectToAction('widgets');
}
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
}
return cmsTemplate::getInstance()->render('widgets_page', array('do' => 'edit', 'page' => $page, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
开发者ID:asphix,项目名称:icms2,代码行数:29,代码来源:widgets_page_edit.php
示例9: run
public function run()
{
if (!$this->request->isAjax()) {
cmsCore::error404();
}
if (!cmsUser::isAllowed('comments', 'edit')) {
cmsCore::error404();
}
$comment_id = $this->request->get('id');
// Проверяем валидность
$is_valid = is_numeric($comment_id);
if (!$is_valid) {
$result = array('error' => true, 'message' => LANG_ERROR);
cmsTemplate::getInstance()->renderJSON($result);
}
$user = cmsUser::getInstance();
$comment = $this->model->getComment($comment_id);
if (!cmsUser::isAllowed('comments', 'edit', 'all')) {
if (cmsUser::isAllowed('comments', 'edit', 'own') && $comment['user']['id'] != $user->id) {
$result = array('error' => true, 'message' => LANG_ERROR);
cmsTemplate::getInstance()->renderJSON($result);
}
}
// Формируем и возвращаем результат
$result = array('error' => $comment ? false : true, 'id' => $comment_id, 'html' => $comment ? string_strip_br($comment['content']) : false);
cmsTemplate::getInstance()->renderJSON($result);
}
开发者ID:asphix,项目名称:icms2,代码行数:27,代码来源:get.php
示例10: run
public function run($pass_token)
{
if (!$pass_token) {
cmsCore::error404();
}
$users_model = cmsCore::getModel('users');
$profile = $users_model->getUserByPassToken($pass_token);
if (!$profile) {
cmsCore::error404();
}
$form = $this->getForm('reset');
$is_submitted = $this->request->has('submit');
if ($is_submitted) {
$profile = array_merge($profile, $form->parse($this->request, $is_submitted));
$errors = $form->validate($this, $profile);
if (!$errors) {
$result = $users_model->updateUser($profile['id'], $profile);
if ($result['success']) {
cmsUser::addSessionMessage(LANG_PASS_CHANGED, 'success');
$users_model->clearUserPassToken($profile['id']);
$this->redirectTo('users', $profile['id']);
} else {
$errors = $result['errors'];
}
}
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
}
return cmsTemplate::getInstance()->render('reset', array('profile' => $profile, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
开发者ID:asphix,项目名称:icms2,代码行数:31,代码来源:reset.php
示例11: run
public function run($ctype_name = false)
{
$query = $this->request->get('q', false);
$type = $this->request->get('type', 'words');
$date = $this->request->get('date', 'all');
$page = $this->request->get('page', 1);
if (!in_array($type, array('words', 'exact'), true)) {
cmsCore::error404();
}
if (!in_array($date, array('all', 'w', 'm', 'y'), true)) {
cmsCore::error404();
}
if (!is_numeric($page)) {
cmsCore::error404();
}
if ($this->request->has('q')) {
if (!$query) {
$this->redirectToAction('');
}
$results = $this->search($query, $type, $date, $ctype_name, $page);
if ($results && !$ctype_name) {
$ctype_name = $results[0]['name'];
$page_url = href_to($this->name);
} else {
$page_url = href_to($this->name, 'index', $ctype_name);
}
}
return cmsTemplate::getInstance()->render('index', array('query' => $query, 'type' => $type, 'date' => $date, 'ctype_name' => $ctype_name, 'page' => $page, 'perpage' => $this->options['perpage'], 'results' => isset($results) ? $results : false, 'page_url' => isset($page_url) ? $page_url : false));
}
开发者ID:pin-git,项目名称:icms2,代码行数:29,代码来源:index.php
示例12: run
public function run()
{
if (!$this->request->isAjax()) {
cmsCore::error404();
}
$comment_id = $this->request->get('comment_id');
$score = $this->request->get('score');
// Проверяем валидность
$is_valid = is_numeric($comment_id) && in_array($score, array(-1, 1));
$template = cmsTemplate::getInstance();
if (!$is_valid) {
$template->renderJSON(array('error' => true));
}
$user = cmsUser::getInstance();
$is_can_rate = cmsUser::isAllowed('comments', 'rate');
if (!$is_can_rate) {
$template->renderJSON(array('error' => true));
}
$is_voted = $this->model->isUserVoted($comment_id, $user->id);
if ($is_voted) {
$template->renderJSON(array('error' => true));
}
$comment = $this->model->getComment($comment_id);
if ($comment['user_id'] == $user->id) {
$template->renderJSON(array('error' => true));
}
$success = $this->model->rateComment($comment_id, $user->id, $score);
$template->renderJSON(array('error' => !$success));
}
开发者ID:asphix,项目名称:icms2,代码行数:29,代码来源:rate.php
示例13: run
public function run($tab = 'all')
{
$user = cmsUser::getInstance();
$dataset_name = false;
$datasets = $this->getDatasets();
if ($tab && isset($datasets[$tab])) {
$dataset_name = $tab;
$dataset = $datasets[$tab];
if (isset($dataset['filter']) && is_callable($dataset['filter'])) {
$this->model = $dataset['filter']($this->model, $dataset);
}
} else {
if ($tab) {
cmsCore::error404();
}
}
// Сортировка
if ($dataset_name) {
$this->model->orderBy($datasets[$dataset_name]['order'][0], $datasets[$dataset_name]['order'][1]);
}
// Формируем базовые URL для страниц
$page_url = array('base' => href_to($this->name, $dataset_name ? 'index/' . $dataset_name : ''), 'first' => href_to($this->name, $dataset_name ? 'index/' . $dataset_name : ''));
// Получаем HTML списка записей
$profiles_list_html = $this->renderProfilesList($page_url, $dataset_name);
return cmsTemplate::getInstance()->render('index', array('datasets' => $datasets, 'dataset_name' => $dataset_name, 'dataset' => $dataset, 'user' => $user, 'profiles_list_html' => $profiles_list_html), $this->request);
}
开发者ID:asphix,项目名称:icms2,代码行数:26,代码来源:index.php
示例14: run
public function run()
{
if (!$this->getPackageContentsDir()) {
$this->redirectToAction('install/finish');
}
$form = $this->getForm('ftp');
$is_submitted = $this->request->has('submit');
$account = cmsUser::isSessionSet('ftp_account') ? cmsUser::sessionGet('ftp_account') : array();
if ($is_submitted) {
$account = array_merge($account, $form->parse($this->request, $is_submitted, $account));
cmsUser::sessionSet('ftp_account', $account);
$errors = $form->validate($this, $account);
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
if (!$errors) {
$account['host'] = trim(str_replace('ftp://', '', $account['host']), '/');
if ($account['path'] != '/') {
$account['path'] = '/' . trim($account['path'], '/') . '/';
}
$this->uploadPackageToFTP($account);
}
}
return cmsTemplate::getInstance()->render('install_ftp', array('account' => $account, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
开发者ID:asphix,项目名称:icms2,代码行数:25,代码来源:install_ftp.php
示例15: run
public function run($feed_id)
{
if (!$feed_id) {
cmsCore::error404();
}
$rss_model = cmsCore::getModel('rss');
$feed = $rss_model->getFeed($feed_id);
$ctype_id = $feed['ctype_id'];
$content_model = cmsCore::getModel('content');
$fields = $content_model->getContentFields($feed['ctype_name']);
$fields = array('' => '') + array_collection_to_list($fields, 'name', 'title');
$form = $this->getForm('feed', array($fields));
$is_submitted = $this->request->has('submit');
if ($is_submitted) {
$feed = $form->parse($this->request, $is_submitted);
$errors = $form->validate($this, $feed);
if (!$errors) {
$rss_model->updateFeed($feed_id, $feed);
$ctype = $content_model->getContentType($ctype_id);
$ctype['options']['is_rss'] = $feed['is_enabled'];
$content_model->updateContentType($ctype_id, array('options' => $ctype['options']));
$this->redirectToAction();
}
if ($errors) {
cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
}
}
return cmsTemplate::getInstance()->render('backend/edit', array('feed' => $feed, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
}
开发者ID:asphix,项目名称:icms2,代码行数:29,代码来源:edit.php
示例16: run
public function run($photo_id = null)
{
if (!$this->request->isAjax()) {
cmsCore::error404();
}
if (!$photo_id) {
$photo_id = $this->request->get('id');
if (!$photo_id) {
cmsCore::error404();
}
}
$photo = $this->model->getPhoto($photo_id);
$success = true;
// проверяем наличие доступа
$user = cmsUser::getInstance();
if (!cmsUser::isAllowed('albums', 'edit')) {
$success = false;
}
if (!cmsUser::isAllowed('albums', 'edit', 'all') && $photo['user_id'] != $user->id) {
$success = false;
}
if (!$success) {
cmsTemplate::getInstance()->renderJSON(array('success' => false));
}
$album = cmsCore::getModel('content')->getContentItem('albums', $photo['album_id']);
$this->model->deletePhoto($photo_id);
$this->model->setRandomAlbumCoverImage($photo['album_id']);
cmsTemplate::getInstance()->renderJSON(array('success' => true, 'album_url' => href_to('albums', $album['slug'] . '.html')));
}
开发者ID:asphix,项目名称:icms2,代码行数:29,代码来源:delete.php
示例17: run
public function run()
{
if (!$this->request->isAjax()) {
cmsCore::error404();
}
$orfo = $this->request->get('orfo');
$url = $this->request->get('url');
$comment = $this->request->get('comment', false);
$author = !cmsUser::isLogged() ? cmsUser::getIp() : cmsUser::get('nickname');
$form = $this->getForm('orfo');
$is_submitted = $this->request->has('submit');
if ($is_submitted) {
$data = $form->parse($this->request, $is_submitted);
$data['date'] = date('Y-m-d H:i:s');
$errors = $form->validate($this, $data);
dump($errors);
if (!$errors) {
$this->model->addComplaints($data);
$messenger = cmsCore::getController('messages');
$messenger->addRecipient(1);
$notice = array('content' => sprintf(LANG_COMPLAINTS_ADD_NOTICE, $url, $orfo), 'options' => array('is_closeable' => true));
$messenger->ignoreNotifyOptions()->sendNoticePM($notice, 'complaints_add');
}
cmsTemplate::getInstance()->renderJSON(array('errors' => false, 'callback' => 'formSuccess'));
}
$data = array('orfo' => $orfo, 'url' => $url, 'author' => $author, 'comment' => $comment);
return cmsTemplate::getInstance()->render('orfo', array('form' => $form, 'data' => $data));
}
开发者ID:mafru,项目名称:icms2,代码行数:28,代码来源:orfo.php
示例18: run
public function run($profile_id)
{
if (!cmsUser::isLogged()) {
cmsCore::error404();
}
if (!$this->request->isAjax()) {
cmsCore::error404();
}
$user = cmsUser::getInstance();
$direction = $this->request->get('direction');
$comment = $this->request->get('comment');
//
// Проверяем валидность
//
$is_valid = $user->is_logged && cmsUser::isAllowed('users', 'vote_karma') && is_numeric($profile_id) && $user->id != $profile_id && in_array($direction, array('up', 'down')) && (!$this->options['is_karma_comments'] || $comment);
if (!$is_valid) {
$result = array('error' => true, 'message' => LANG_ERROR);
cmsTemplate::getInstance()->renderJSON($result);
}
$profile = $this->model->getUser($profile_id);
if (!$profile || !$this->model->isUserCanVoteKarma($user->id, $profile_id, $this->options['karma_time'])) {
$result = array('error' => true, 'message' => LANG_ERROR);
cmsTemplate::getInstance()->renderJSON($result);
}
//
// Сохраняем оценку
//
$vote = array('user_id' => $user->id, 'profile_id' => $profile_id, 'points' => $direction == 'up' ? 1 : -1, 'comment' => $comment);
$vote_id = $this->model->addKarmaVote($vote);
$value = $profile['karma'] + $vote['points'];
$result = array('error' => $vote_id ? false : true, 'value' => html_signed_num($value), 'css_class' => html_signed_class($value));
cmsTemplate::getInstance()->renderJSON($result);
}
开发者ID:asphix,项目名称:icms2,代码行数:33,代码来源:karma_vote.php
示例19: displayEditor
public function displayEditor($field_id, $content = '')
{
$lang = cmsConfig::get('language');
$user = cmsUser::getInstance();
cmsTemplate::getInstance()->addJS('wysiwyg/tinymce/tinymce.min.js');
$dom_id = str_replace(array('[', ']'), array('_', ''), $field_id);
echo html_textarea($field_id, $content, array('id' => $dom_id));
?>
<script type="text/javascript" >
$(document).ready(function(){
tinymce.init({mode : "exact",
elements : "<?php
echo $field_id;
?>
",
language : "ru",
plugins: [
"link image lists media responsivefilemanager "
],
relative_urls: false,
filemanager_title:"Responsive Filemanager",
external_filemanager_path:"/filemanager/",
external_plugins: { "filemanager" : "/filemanager/plugin.min.js"},
image_advtab: true,
toolbar1: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect",
toolbar2: "| responsivefilemanager | image | media | link unlink anchor | "
});
});
</script>
<?php
}
开发者ID:comaw,项目名称:hashtag,代码行数:34,代码来源:wysiwyg.class.php
示例20: init
public function init($do)
{
$template = cmsTemplate::getInstance();
return array('titles' => array('type' => 'fieldset', 'childs' => array(new fieldString('name', array('title' => LANG_SYSTEM_NAME, 'hint' => LANG_CP_SYSTEM_NAME_HINT, 'rules' => array(array('required'), array('sysname'), $do == 'add' ? array('unique', 'content_types', 'name') : false))), new fieldString('title', array('title' => LANG_TITLE, 'rules' => array(array('required'), array('max_length', 100)))), new fieldString('description', array('title' => LANG_DESCRIPTION, 'rules' => array(array('max_length', 255)))))), 'pub' => array('type' => 'fieldset', 'title' => LANG_CP_PUBLICATION, 'childs' => array(new fieldCheckbox('is_premod_add', array('title' => LANG_CP_PREMOD_ADD)), new fieldCheckbox('is_premod_edit', array('title' => LANG_CP_PREMOD_EDIT)), new fieldCheckbox('is_date_range', array('title' => LANG_CP_IS_PUB_CONTROL, 'hint' => LANG_CP_IS_PUB_CONTROL_HINT)), new fieldList('options:is_date_range_process', array('title' => LANG_CP_IS_PUB_CONTROL_PROCESS, 'default' => 'hide', 'items' => array('hide' => LANG_CP_IS_PUB_CONTROL_PROCESS_HIDE, 'delete' => LANG_CP_IS_PUB_CONTROL_PROCESS_DEL))))), 'categories' => array('type' => 'fieldset', 'title' => LANG_CP_CATEGORIES, 'childs' => array(new fieldCheckbox('is_cats', array('title' => LANG_CP_CATEGORIES_ON)), new fieldCheckbox('is_cats_recursive', array('title' => LANG_CP_CATEGORIES_RECURSIVE)), new fieldCheckbox('options:is_empty_root', array('title' => LANG_CP_CATEGORIES_EMPTY_ROOT)), new fieldCheckbox('options:is_cats_multi', array('title' => LANG_CP_CATEGORIES_MULTI)), new fieldCheckbox('options:is_cats_change', array('title' => LANG_CP_CATEGORIES_CHANGE, 'default' => true)), new fieldCheckbox('options:is_cats_open_root', array('title' => LANG_CP_CATEGORIES_OPEN_ROOT)), new fieldCheckbox('options:is_cats_only_last', array('title' => LANG_CP_CATEGORIES_ONLY_LAST)), new fieldCheckbox('options:is_show_cats', array('title' => LANG_CP_CATEGORIES_SHOW)))), 'folders' => array('type' => 'fieldset', 'title' => LANG_CP_FOLDERS, 'childs' => array(new fieldCheckbox('is_folders', array('title' => LANG_CP_FOLDERS_ON, 'hint' => LANG_CP_FOLDERS_HINT)))), 'groups' => array('type' => 'fieldset', 'title' => LANG_CP_CT_GROUPS, 'childs' => array(new fieldCheckbox('is_in_groups', array('title' => LANG_CP_CT_GROUPS_ALLOW)), new fieldCheckbox('is_in_groups_only', array('title' => LANG_CP_CT_GROUPS_ALLOW_ONLY)))), 'comments' => array('type' => 'fieldset', 'title' => LANG_CP_COMMENTS, 'childs' => array(new fieldCheckbox('is_comments', array('title' => LANG_CP_COMMENTS_ON)))), 'ratings' => array('type' => 'fieldset', 'title' => LANG_CP_RATING, 'childs' => array(new fieldCheckbox('is_rating', array('title' => LANG_CP_RATING_ON)))), 'tags' => array('type' => 'fieldset', 'title' => LANG_TAGS, 'childs' => array(new fieldCheckbox('is_tags', array('title' => LANG_CP_TAGS_ON)), new fieldCheckbox('options:is_tags_in_list', array('title' => LANG_CP_TAGS_IN_LIST)), new fieldCheckbox('options:is_tags_in_item', array('title' => LANG_CP_TAGS_IN_ITEM)))), 'listview' => array('type' => 'fieldset', 'title' => LANG_CP_LISTVIEW_OPTIONS, 'childs' => array(new fieldCheckbox('options:list_on', array('title' => LANG_CP_LISTVIEW_ON, 'default' => true)), new fieldCheckbox('options:profile_on', array('title' => LANG_CP_PROFILELIST_ON, 'default' => true)), new fieldCheckbox('options:list_show_filter', array('title' => LANG_CP_LISTVIEW_FILTER)), new fieldCheckbox('options:list_expand_filter', array('title' => LANG_CP_LISTVIEW_FILTER_EXPAND)), new fieldList('options:list_style', array('title' => LANG_CP_LISTVIEW_STYLE, 'hint' => sprintf(LANG_CP_LISTVIEW_STYLE_HINT, $template->getName()), 'generator' => function () use($template) {
return $template->getAvailableContentListStyles();
})), new fieldList('options:privacy_type', array('title' => LANG_CP_PRIVACY_TYPE, 'default' => 'hide', 'items' => array('hide' => LANG_CP_PRIVACY_TYPE_HIDE, 'show_title' => LANG_CP_PRIVACY_TYPE_SHOW_TITLE, 'show_all' => LANG_CP_PRIVACY_TYPE_SHOW_ALL))), new fieldNumber('options:limit', array('title' => LANG_LIST_LIMIT, 'default' => 15, 'rules' => array(array('required')))))), 'itemview' => array('type' => 'fieldset', 'title' => LANG_CP_ITEMVIEW_OPTIONS, 'childs' => array(new fieldCheckbox('options:item_on', array('title' => LANG_CP_ITEMVIEW_ON, 'default' => true)), new fieldCheckbox('options:hits_on', array('title' => LANG_CP_ITEMVIEW_HITS_ON)), new fieldText('item_append_html', array('title' => LANG_CP_ITEMVIEW_APPEND_HTML, 'hint' => LANG_CP_ITEMVIEW_APPEND_HTML_HINT)))), 'seo-items' => array('type' => 'fieldset', 'title' => LANG_CP_SEOMETA, 'childs' => array(new fieldCheckbox('options:is_manual_title', array('title' => LANG_CP_SEOMETA_MANUAL_TITLE)), new fieldCheckbox('is_auto_keys', array('title' => LANG_CP_SEOMETA_AUTO_KEYS, 'default' => true)), new fieldCheckbox('is_auto_desc', array('title' => LANG_CP_SEOMETA_AUTO_DESC, 'default' => true)), new fieldCheckbox('is_auto_url', array('title' => LANG_CP_AUTO_URL, 'default' => true)), new fieldCheckbox('is_fixed_url', array('title' => LANG_CP_FIXED_URL)), new fieldString('url_pattern', array('title' => LANG_CP_URL_PATTERN, 'prefix' => '/articles/', 'suffix' => '.html', 'default' => '{id}-{title}', 'rules' => array(array('required')))))), 'seo-cats' => array('type' => 'fieldset', 'title' => LANG_CP_SEOMETA_CATS, 'childs' => array(new fieldCheckbox('options:is_cats_title', array('title' => LANG_CP_SEOMETA_CATS_TITLE)), new fieldCheckbox('options:is_cats_keys', array('title' => LANG_CP_SEOMETA_CATS_KEYS)), new fieldCheckbox('options:is_cats_desc', array('title' => LANG_CP_SEOMETA_CATS_DESC)), new fieldCheckbox('options:is_cats_auto_url', array('title' => LANG_CP_CATS_AUTO_URL, 'default' => true)))), 'seo' => array('type' => 'fieldset', 'title' => LANG_CP_SEOMETA_DEFAULT, 'childs' => array(new fieldString('seo_title', array('title' => LANG_SEO_TITLE)), new fieldString('seo_keys', array('title' => LANG_SEO_KEYS, 'hint' => LANG_SEO_KEYS_HINT)), new fieldText('seo_desc', array('title' => LANG_SEO_DESC, 'hint' => LANG_SEO_DESC_HINT)))));
}
开发者ID:Val-Git,项目名称:icms2,代码行数:7,代码来源:form_ctypes_basic.php
注:本文中的cmsTemplate类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论