本文整理汇总了PHP中cpGetList函数的典型用法代码示例。如果您正苦于以下问题:PHP cpGetList函数的具体用法?PHP cpGetList怎么用?PHP cpGetList使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cpGetList函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: applet_arhive
function applet_arhive()
{
$inCore = cmsCore::getInstance();
global $_LANG;
cmsCore::c('page')->setTitle($_LANG['AD_ARTICLES_ARCHIVE']);
$cfg = $inCore->loadComponentConfig('content');
$cfg_arhive = $inCore->loadComponentConfig('arhive');
cpAddPathway($_LANG['AD_ARTICLE_SITE'], 'index.php?view=tree');
cpAddPathway($_LANG['AD_ARTICLES_ARCHIVE'], 'index.php?view=arhive');
$do = cmsCore::request('do', 'str', 'list');
$id = cmsCore::request('id', 'int', -1);
if ($do == 'saveconfig') {
if (!cmsUser::checkCsrfToken()) {
cmsCore::error404();
}
$cfg['source'] = cmsCore::request('source', 'str', '');
$inCore->saveComponentConfig('arhive', $cfg);
cmsCore::addSessionMessage($_LANG['AD_CONFIG_SAVE_SUCCESS'], 'success');
cmsCore::redirect('?view=arhive&do=config');
}
if ($do == 'config') {
$toolmenu = array(array('icon' => 'folders.gif', 'title' => $_LANG['AD_LIST_OF_ARTICLES'], 'link' => '?view=arhive'));
cpToolMenu($toolmenu);
cpAddPathway($_LANG['AD_SETTINGS'], 'index.php?view=arhive&do=config');
cmsCore::c('page')->initTemplate('applets', 'arhive')->assign('cfg_arhive', $cfg_arhive)->display();
}
if ($do == 'list') {
$toolmenu = array(array('icon' => 'config.gif', 'title' => $_LANG['AD_SETTINGS'], 'link' => '?view=arhive&do=config'), array('icon' => 'delete.gif', 'title' => $_LANG['AD_DELETE_SELECTED'], 'link' => "javascript:checkSel('?view=arhive&do=delete&multiple=1');"));
cpToolMenu($toolmenu);
//TABLE COLUMNS
$fields = array(array('title' => 'id', 'field' => 'id', 'width' => '40'), array('title' => $_LANG['AD_CREATE'], 'field' => 'pubdate', 'width' => '80', 'filter' => 15, 'fdate' => '%d/%m/%Y'), array('title' => $_LANG['TITLE'], 'field' => 'title', 'width' => '', 'link' => '?view=content&do=edit&id=%id%', 'filter' => 15), array('title' => $_LANG['AD_PARTITION'], 'field' => 'category_id', 'width' => '150', 'filter' => 1, 'prc' => 'cpCatById', 'filterlist' => cpGetList('cms_category')));
//ACTIONS
$actions = array(array('title' => $_LANG['AD_TO_ARTICLES_CATALOG'], 'icon' => 'arhive_off.gif', 'link' => '?view=arhive&do=arhive_off&id=%id%'), array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'link' => '?view=content&do=delete&id=%id%', 'confirm' => $_LANG['AD_DELETE_MATERIALS']));
//Print table
cpListTable('cms_content', $fields, $actions, 'is_arhive=1');
}
if ($do == 'arhive_off') {
if (cmsCore::inRequest('id')) {
cmsCore::c('db')->setFlag('cms_content', $id, 'is_arhive', '0');
cmsCore::redirect('?view=arhive');
}
}
if ($do == 'delete') {
if (!cmsCore::inRequest('item')) {
if ($id >= 0) {
cmsCore::m('content')->deleteArticle($id, $cfg['af_delete']);
}
} else {
cmsCore::m('content')->deleteArticles(cmsCore::request('item', 'array_int'), $cfg['af_delete']);
}
cmsCore::redirect('?view=arhive');
}
}
示例2: applet_cats
//.........这里部分代码省略.........
}
//подгружаем параметры фото
$small_size_w = cmsCore::request('img_small_w', 'str', '');
$medium_size_w = cmsCore::request('img_big_w', 'str', '');
$thumbsqr = cmsCore::request('img_sqr', 'str', '');
// Загружаем класс загрузки фото
cmsCore::loadClass('upload_photo');
$inUploadPhoto = cmsUploadPhoto::getInstance();
// Выставляем конфигурационные параметры
$inUploadPhoto->upload_dir = PATH . '/images/photos/';
$inUploadPhoto->small_size_w = $small_size_w;
$inUploadPhoto->medium_size_w = $medium_size_w;
$inUploadPhoto->thumbsqr = $thumbsqr;
$inUploadPhoto->is_watermark = $model->config['watermark'];
$inUploadPhoto->input_name = 'picture';
$inUploadPhoto->filename = $file;
// Процесс загрузки фото
$inUploadPhoto->uploadPhoto();
//var_dump($inUploadPhoto);
cmsCore::addSessionMessage($_LANG['AD_CATEGORY_ADD'], 'success');
cmsCore::redirect('?view=tree');
}
if ($do == 'add' || $do == 'edit') {
require '../includes/jwtabs.php';
$GLOBALS['cp_page_head'][] = jwHeader();
$toolmenu = array();
$toolmenu[0]['icon'] = 'save.gif';
$toolmenu[0]['title'] = $_LANG['SAVE'];
$toolmenu[0]['link'] = 'javascript:document.addform.submit();';
$toolmenu[1]['icon'] = 'cancel.gif';
$toolmenu[1]['title'] = $_LANG['CANCEL'];
$toolmenu[1]['link'] = 'javascript:history.go(-1);';
cpToolMenu($toolmenu);
$menu_list = cpGetList('menu');
if ($do == 'add') {
echo '<h3>' . $_LANG['AD_CREATE_SECTION'] . '</h3>';
cpAddPathway($_LANG['AD_CREATE_SECTION'], 'index.php?view=cats&do=add');
$mod['tpl'] = 'com_content_view.tpl';
} else {
if (isset($_REQUEST['multiple'])) {
if (isset($_REQUEST['item'])) {
$_SESSION['editlist'] = $_REQUEST['item'];
} else {
echo '<p class="error">' . $_LANG['AD_NO_SELECT_OBJECTS'] . '</p>';
return;
}
}
$ostatok = '';
if (isset($_SESSION['editlist'])) {
$id = array_shift($_SESSION['editlist']);
if (sizeof($_SESSION['editlist']) == 0) {
unset($_SESSION['editlist']);
} else {
$ostatok = '(' . $_LANG['AD_NEXT_IN'] . sizeof($_SESSION['editlist']) . ')';
}
} else {
$id = (int) $_REQUEST['id'];
}
$sql = "SELECT * FROM cms_category WHERE id = {$id} LIMIT 1";
$result = $inDB->query($sql);
if ($inDB->num_rows($result)) {
$mod = $inDB->fetch_assoc($result);
if (@$mod['photoalbum']) {
$mod['photoalbum'] = unserialize($mod['photoalbum']);
}
}
示例3: array
array( 'title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_DELETE_CATEGORY'], 'link' => '?view=components&do=config&id='. $id .'&opt=delete_cat&item_id=%id%' )
);
cpListTable('cms_forum_cats', $fields, $actions);
}
if ($opt == 'list_forums') {
echo '<h3>'. $_LANG['AD_FORUMS'] .'</h3>';
$fields = array(
array( 'title' => 'id', 'field' => 'id', 'width' => '40' ),
array( 'title' => $_LANG['TITLE'], 'field' => 'title', 'width' => '', 'link' => '?view=components&do=config&id='. $id .'&opt=edit_forum&item_id=%id%', 'filter' => '15' ),
array( 'title' => $_LANG['AD_TOPICS'], 'field' => 'thread_count', 'width' => '60'),
array( 'title' => $_LANG['AD_FORUM_MESSAGES'], 'field' => 'post_count', 'width' => '90' ),
array( 'title' => $_LANG['AD_IS_PUBLISHED'], 'field' => 'published', 'width' => '60', 'do' => 'opt', 'do_suffix' => '_forum' ),
array( 'title' => $_LANG['AD_CATEGORY'], 'field' => 'category_id', 'width' => '150', 'prc' => 'cpForumCatById', 'filter' => '1', 'filterlist' => cpGetList('cms_forum_cats'))
);
$actions = array(
array( 'title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '?view=components&do=config&id='. $id .'&opt=edit_forum&item_id=%id%' ),
array( 'title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_FORUM_DELETE'], 'link' => '?view=components&do=config&id='. $id .'&opt=delete_forum&item_id=%id%' )
);
cpListTable('cms_forums', $fields, $actions, 'parent_id>0', 'NSLeft');
}
if ($opt == 'add_cat' || $opt == 'edit_cat') {
if ($opt == 'add_cat') {
echo '<h3>'. $_LANG['AD_CREATE_CATEGORY'] .'</h3>';
cpAddPathway($_LANG['AD_CREATE_CATEGORY']);
$mod = array( 'published' => 1, 'ordering' => (int)cmsCore::c('db')->get_field('cms_forum_cats', '1=1 ORDER BY ordering DESC', 'ordering')+1 );
示例4: applet_menu
function applet_menu()
{
$inCore = cmsCore::getInstance();
$inDB = cmsDatabase::getInstance();
global $_LANG;
global $adminAccess;
if (!cmsUser::isAdminCan('admin/menu', $adminAccess)) {
cpAccessDenied();
}
$GLOBALS['cp_page_title'] = $_LANG['AD_MENU'];
cpAddPathway($_LANG['AD_MENU'], 'index.php?view=menu');
$do = cmsCore::request('do', 'str', 'list');
$id = cmsCore::request('id', 'int', -1);
if ($do == 'list') {
$toolmenu[] = array('icon' => 'new.gif', 'title' => $_LANG['AD_MENU_POINT_ADD'], 'link' => '?view=menu&do=add');
$toolmenu[] = array('icon' => 'newmenu.gif', 'title' => $_LANG['AD_MENU_ADD'], 'link' => '?view=menu&do=addmenu');
$toolmenu[] = array('icon' => 'edit.gif', 'title' => $_LANG['AD_EDIT_SELECTED'], 'link' => "javascript:checkSel('?view=menu&do=edit&multiple=1');");
$toolmenu[] = array('icon' => 'delete.gif', 'title' => $_LANG['AD_DELETE_SELECTED'], 'link' => "javascript:checkSel('?view=menu&do=delete&multiple=1');");
$toolmenu[] = array('icon' => 'show.gif', 'title' => $_LANG['AD_ALLOW_SELECTED'], 'link' => "javascript:checkSel('?view=menu&do=show&multiple=1');");
$toolmenu[] = array('icon' => 'hide.gif', 'title' => $_LANG['AD_DISALLOW_SELECTED'], 'link' => "javascript:checkSel('?view=menu&do=hide&multiple=1');");
$toolmenu[] = array('icon' => 'help.gif', 'title' => $_LANG['AD_HELP'], 'link' => '?view=help&topic=menu');
cpToolMenu($toolmenu);
$fields[] = array('title' => 'Lt', 'field' => 'NSLeft', 'width' => '30');
$fields[] = array('title' => $_LANG['TITLE'], 'field' => 'title', 'width' => '', 'link' => '?view=menu&do=edit&id=%id%');
$fields[] = array('title' => $_LANG['SHOW'], 'field' => 'published', 'width' => '60');
$fields[] = array('title' => $_LANG['AD_ORDER'], 'field' => 'ordering', 'width' => '100');
$fields[] = array('title' => $_LANG['AD_LINK'], 'field' => array('linktype', 'linkid', 'link'), 'width' => '240', 'prc' => 'cpMenutypeById');
$fields[] = array('title' => $_LANG['AD_MENU'], 'field' => 'menu', 'width' => '70', 'filter' => '10', 'filterlist' => cpGetList('menu'), 'prc' => 'list_menu');
$fields[] = array('title' => $_LANG['TEMPLATE'], 'field' => 'template', 'width' => '70', 'prc' => 'cpTemplateById');
$actions[] = array('title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '?view=menu&do=edit&id=%id%');
$actions[] = array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_MENU_POINT_CONFIRM'], 'link' => '?view=menu&do=delete&id=%id%');
cpListTable('cms_menu', $fields, $actions, 'parent_id>0', 'NSLeft, ordering');
} else {
$toolmenu[] = array('icon' => 'save.gif', 'title' => $_LANG['SAVE'], 'link' => 'javascript:document.addform.submit();');
$toolmenu[] = array('icon' => 'cancel.gif', 'title' => $_LANG['CANCEL'], 'link' => 'index.php?view=menu');
cpToolMenu($toolmenu);
}
if ($do == 'move_up') {
$inDB->moveNsCategory('cms_menu', $id, 'up');
cmsCore::redirectBack();
}
if ($do == 'move_down') {
$inDB->moveNsCategory('cms_menu', $id, 'down');
cmsCore::redirectBack();
}
if ($do == 'show') {
if (!isset($_REQUEST['item'])) {
if ($id >= 0) {
dbShow('cms_menu', $id);
}
echo '1';
exit;
} else {
dbShowList('cms_menu', $_REQUEST['item']);
cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
cmsCore::redirectBack();
}
}
if ($do == 'hide') {
if (!isset($_REQUEST['item'])) {
if ($id >= 0) {
dbHide('cms_menu', $id);
}
echo '1';
exit;
} else {
dbHideList('cms_menu', cmsCore::request('item', 'array_int', array()));
cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
cmsCore::redirectBack();
}
}
if ($do == 'delete') {
if (!isset($_REQUEST['item'])) {
if ($id >= 0) {
$inDB->deleteNS('cms_menu', (int) $id);
}
} else {
$items = cmsCore::request('item', 'array_int', array());
foreach ($items as $item_id) {
$inDB->deleteNS('cms_menu', $item_id);
}
}
cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
cmsCore::redirectBack();
}
if ($do == 'update') {
if (!cmsUser::checkCsrfToken()) {
cmsCore::error404();
}
$id = cmsCore::request('id', 'int', 0);
if (!$id) {
cmsCore::redirectBack();
}
$title = cmsCore::request('title', 'str', '');
$menu = cmsCore::arrayToYaml(cmsCore::request('menu', 'array_str', ''));
$linktype = cmsCore::request('mode', 'str', '');
$linkid = cmsCore::request($linktype, 'str', '');
$link = $inCore->getMenuLink($linktype, $linkid);
$target = cmsCore::request('target', 'str', '');
$published = cmsCore::request('published', 'int', 0);
//.........这里部分代码省略.........
示例5: applet_modules
//.........这里部分代码省略.........
$inCore->saveModuleConfig($id, $cfg);
if (!$is_ajax) {
cmsCore::addSessionMessage($_LANG['AD_CONFIG_SAVE_SUCCESS'], 'success');
}
cmsCore::redirectBack();
}
//============================================================================//
//============================================================================//
if ($do == 'list') {
$toolmenu[] = array('icon' => 'new.gif', 'title' => $_LANG['AD_MODULE_ADD'], 'link' => '?view=modules&do=add');
$toolmenu[] = array('icon' => 'install.gif', 'title' => $_LANG['AD_MODULES_SETUP'], 'link' => '?view=install&do=module');
$toolmenu[] = array('icon' => 'edit.gif', 'title' => $_LANG['AD_EDIT_SELECTED'], 'link' => "javascript:checkSel('?view=modules&do=edit&multiple=1');");
$toolmenu[] = array('icon' => 'delete.gif', 'title' => $_LANG['AD_DELETE_SELECTED'], 'link' => "javascript:checkSel('?view=modules&do=delete&multiple=1');");
$toolmenu[] = array('icon' => 'show.gif', 'title' => $_LANG['AD_ALLOW_SELECTED'], 'link' => "javascript:checkSel('?view=modules&do=show&multiple=1');");
$toolmenu[] = array('icon' => 'hide.gif', 'title' => $_LANG['AD_DISALLOW_SELECTED'], 'link' => "javascript:checkSel('?view=modules&do=hide&multiple=1');");
$toolmenu[] = array('icon' => 'autoorder.gif', 'title' => $_LANG['AD_MODULE_ORDER'], 'link' => '?view=modules&do=autoorder');
$toolmenu[] = array('icon' => 'reorder.gif', 'title' => $_LANG['AD_SAVE_ORDER'], 'link' => "javascript:checkSel('?view=modules&do=saveorder');");
$toolmenu[] = array('icon' => 'help.gif', 'title' => $_LANG['AD_HELP'], 'link' => '?view=help&topic=modules');
cpToolMenu($toolmenu);
$fields[] = array('title' => 'id', 'field' => 'id', 'width' => '30');
$fields[] = array('title' => $_LANG['AD_TITLE'], 'field' => array('title', 'titles'), 'width' => '', 'link' => '?view=modules&do=edit&id=%id%', 'prc' => function ($i) {
$i['titles'] = cmsCore::yamlToArray($i['titles']);
// переопределяем название пункта меню в зависимости от языка
if (!empty($i['titles'][cmsConfig::getConfig('lang')])) {
$i['title'] = $i['titles'][cmsConfig::getConfig('lang')];
}
return $i['title'];
});
$fields[] = array('title' => $_LANG['TITLE'], 'field' => 'name', 'width' => '220', 'filter' => '15');
$fields[] = array('title' => $_LANG['AD_VERSION'], 'field' => 'version', 'width' => '55');
$fields[] = array('title' => $_LANG['AD_AUTHOR'], 'field' => 'author', 'width' => '110');
$fields[] = array('title' => $_LANG['SHOW'], 'field' => 'published', 'width' => '65');
$fields[] = array('title' => $_LANG['AD_ORDER'], 'field' => 'ordering', 'width' => '75');
$fields[] = array('title' => $_LANG['AD_POSITION'], 'field' => 'position', 'width' => '70', 'filter' => '10', 'filterlist' => cpGetList('positions'));
$actions[] = array('title' => $_LANG['AD_CONFIG'], 'icon' => 'config.gif', 'link' => '?view=modules&do=config&id=%id%', 'condition' => 'cpModuleHasConfig');
$actions[] = array('title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '?view=modules&do=edit&id=%id%');
$actions[] = array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_MODULE_DELETE'], 'link' => '?view=modules&do=delete&id=%id%');
cpListTable('cms_modules', $fields, $actions, '', 'published DESC, position, ordering ASC');
}
//============================================================================//
//============================================================================//
if ($do == 'autoorder') {
$rs = $inDB->query("SELECT id, position FROM cms_modules ORDER BY position");
if ($inDB->num_rows($rs)) {
$ord = 1;
while ($item = $inDB->fetch_assoc($rs)) {
if (isset($latest_pos)) {
if ($latest_pos != $item['position']) {
$ord = 1;
}
}
$inDB->query("UPDATE cms_modules SET ordering = {$ord} WHERE id='{$item['id']}'");
$ord += 1;
$latest_pos = $item['position'];
}
}
cmsCore::redirect('index.php?view=modules');
}
//============================================================================//
//============================================================================//
if ($do == 'move_up') {
if ($id >= 0) {
dbMoveUp('cms_modules', $id, $co);
}
cmsCore::redirectBack();
}
示例6: applet_content
//.........这里部分代码省略.........
case 3: $article['meta_desc'] = cmsCore::request('meta_desc', 'str');
$article['meta_keys'] = cmsCore::request('meta_keys', 'str');
break;
}
$article['id'] = cmsCore::m('content')->addArticle($article);
if (!cmsCore::request('is_public', 'int', 0)) {
$showfor = cmsCore::request('showfor', 'array_int', array());
cmsCore::setAccess($article['id'], $showfor, 'material');
}
$inmenu = cmsCore::request('createmenu', 'str', '');
if ($inmenu) {
createMenuItem($inmenu, $article['id'], $article['title']);
}
cmsCore::m('content')->uploadArticeImage($article['id']);
cmsCore::addSessionMessage($_LANG['AD_ARTICLE_ADD'], 'success');
cmsCore::redirect('?view=tree&cat_id='. $article['category_id']);
}
if ($do == 'add' || $do == 'edit') {
$toolmenu = array(
array( 'icon' => 'save.gif', 'title' => $_LANG['SAVE'], 'link' => 'javascript:document.addform.submit();' ),
array( 'icon' => 'cancel.gif', 'title' => $_LANG['CANCEL'], 'link' => 'javascript:history.go(-1);' )
);
cpToolMenu($toolmenu);
$menu_list = cpGetList('menu');
if ($do == 'add') {
echo '<h3>'. $_LANG['AD_CREATE_ARTICLE'] .'</h3>';
cpAddPathway($_LANG['AD_CREATE_ARTICLE'], 'index.php?view=content&do=add');
$mod = array(
'category_id' => cmsCore::request('to', 'int'),
'showpath' => 1,
'tpl' => 'com_content_read'
);
} else {
if (isset($_REQUEST['item'])){
$_SESSION['editlist'] = $_REQUEST['item'];
}
$ostatok = '';
if (isset($_SESSION['editlist'])) {
$id = array_shift($_SESSION['editlist']);
if (count($_SESSION['editlist'])==0) {
unset($_SESSION['editlist']);
} else {
$ostatok = '('. $_LANG['AD_NEXT_IN'] . count($_SESSION['editlist']) .')';
}
} else {
$id = (int)$_REQUEST['id'];
}
$sql = "SELECT *, (TO_DAYS(enddate) - TO_DAYS(CURDATE())) as daysleft, DATE_FORMAT(pubdate, '%d.%m.%Y') as pubdate, DATE_FORMAT(enddate, '%d.%m.%Y') as enddate
FROM cms_content
WHERE id = ". $id ." LIMIT 1";
$result = cmsCore::c('db')->query($sql) ;
示例7: applet_modules
//.........这里部分代码省略.........
array( 'icon' => 'install.gif', 'title' => $_LANG['AD_MODULES_SETUP'], 'link' => '?view=install&do=module' ),
array( 'icon' => 'edit.gif', 'title' => $_LANG['AD_EDIT_SELECTED'], 'link' => "javascript:checkSel('?view=modules&do=edit&multiple=1');" ),
array( 'icon' => 'delete.gif', 'title' => $_LANG['AD_DELETE_SELECTED'], 'link' => "javascript:checkSel('?view=modules&do=delete&multiple=1');" ),
array( 'icon' => 'show.gif', 'title' => $_LANG['AD_ALLOW_SELECTED'], 'link' => "javascript:checkSel('?view=modules&do=show&multiple=1');" ),
array( 'icon' => 'hide.gif', 'title' => $_LANG['AD_DISALLOW_SELECTED'], 'link' => "javascript:checkSel('?view=modules&do=hide&multiple=1');" ),
array( 'icon' => 'autoorder.gif', 'title' => $_LANG['AD_MODULE_ORDER'], 'link' => '?view=modules&do=autoorder' ),
array( 'icon' => 'reorder.gif', 'title' => $_LANG['AD_SAVE_ORDER'], 'link' => "javascript:checkSel('?view=modules&do=saveorder');" ),
array( 'icon' => 'help.gif', 'title' => $_LANG['AD_HELP'], 'link' => '?view=help&topic=modules' )
);
cpToolMenu($toolmenu);
$fields = array(
array( 'title' => 'id', 'field' => 'id', 'width' => '40' ),
array(
'title' => $_LANG['AD_TITLE'],
'field' => array('title','titles'), 'width'=>'',
'link' => '?view=modules&do=edit&id=%id%',
'prc' => function ($i) {
$i['titles'] = cmsCore::yamlToArray($i['titles']);
// переопределяем название пункта меню в зависимости от языка
if (!empty($i['titles'][cmsConfig::getConfig('lang')])) {
$i['title'] = $i['titles'][cmsConfig::getConfig('lang')];
}
return $i['title'];
}
),
array( 'title' => $_LANG['TITLE'], 'field' => 'name', 'width' => '220', 'filter' => '15' ),
array( 'title' => $_LANG['AD_VERSION'], 'field' => 'version', 'width' => '70' ),
array( 'title' => $_LANG['AD_AUTHOR'], 'field' => 'author', 'width' => '110' ),
array( 'title' => $_LANG['SHOW'], 'field' => 'published', 'width' => '80' ),
array( 'title' => $_LANG['AD_ORDER'], 'field' => 'ordering', 'width' => '100' ),
array( 'title' => $_LANG['AD_POSITION'], 'field' => 'position', 'width' => '80', 'filter' => '10', 'filterlist' => cpGetList('positions') )
);
$actions = array(
array( 'title' => $_LANG['AD_CONFIG'], 'icon' => 'config.gif', 'link' => '?view=modules&do=config&id=%id%', 'condition' => 'cpModuleHasConfig' ),
array( 'title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '?view=modules&do=edit&id=%id%' ),
array( 'title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_MODULE_DELETE'], 'link' => '?view=modules&do=delete&id=%id%' )
);
cpListTable('cms_modules', $fields, $actions, '', 'published DESC, position, ordering ASC');
}
if ($do == 'autoorder'){
$rs = cmsCore::c('db')->query("SELECT id, position FROM cms_modules ORDER BY position") ;
if (cmsCore::c('db')->num_rows($rs)) {
$ord = 1;
while ($item = cmsCore::c('db')->fetch_assoc($rs)) {
if (isset($latest_pos)) {
if ($latest_pos != $item['position']) {
$ord = 1;
}
}
cmsCore::c('db')->query("UPDATE cms_modules SET ordering = ". $ord ." WHERE id=". $item['id']) ;
$ord += 1;
$latest_pos = $item['position'];
}
}
cmsCore::redirect('index.php?view=modules');
}
if ($do == 'move_up') {
示例8: cpAddPathway
cmsCore::c('db')->deleteNS('cms_board_cats', $item_id);
if (file_exists(PATH . '/upload/board/cat_icons/' . $f_icon)) {
@chmod(PATH . '/upload/board/cat_icons/' . $f_icon, 0777);
@unlink(PATH . '/upload/board/cat_icons/' . $f_icon);
}
cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
cmsCore::redirect('?view=components&do=config&id=' . $id . '&opt=list_cats');
}
if ($opt == 'list_cats') {
cpAddPathway($_LANG['AD_ALL_CAT']);
$fields = array(array('title' => 'id', 'field' => 'id', 'width' => '40'), array('title' => $_LANG['TITLE'], 'field' => 'title', 'width' => '', 'link' => '?view=components&do=config&id=' . $id . '&opt=edit_cat&item_id=%id%'), array('title' => $_LANG['AD_IS_PUBLISHED'], 'field' => 'published', 'width' => '100', 'do' => 'opt', 'do_suffix' => '_cat'));
$actions = array(array('title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '?view=components&do=config&id=' . $id . '&opt=edit_cat&item_id=%id%'), array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_IF_CAT_DELETE'], 'link' => '?view=components&do=config&id=' . $id . '&opt=delete_cat&item_id=%id%'));
cpListTable('cms_board_cats', $fields, $actions, 'parent_id>0', 'NSLeft');
}
if ($opt == 'list_items') {
$fields = array(array('title' => 'id', 'field' => 'id', 'width' => '40'), array('title' => $_LANG['DATE'], 'field' => 'pubdate', 'width' => '80', 'filter' => '15', 'fdate' => '%d/%m/%Y'), array('title' => $_LANG['TYPE'], 'field' => 'obtype', 'width' => '80', 'filter' => '15'), array('title' => $_LANG['AD_TITLE'], 'field' => 'title', 'width' => '', 'filter' => '15', 'link' => '/board/edit%id%.html'), array('title' => $_LANG['AD_IS_PUBLISHED'], 'field' => 'published', 'width' => '60', 'do' => 'opt', 'do_suffix' => '_item'), array('title' => $_LANG['AD_VIEWS'], 'field' => 'hits', 'width' => '100'), array('title' => 'IP', 'field' => 'ip', 'width' => '80', 'prc' => 'long2ip'), array('title' => $_LANG['CAT_BOARD'], 'field' => 'category_id', 'width' => '230', 'prc' => 'cpBoardCatById', 'filter' => '1', 'filterlist' => cpGetList('cms_board_cats')));
$actions = array(array('title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '/board/edit%id%.html'), array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['DELETE_ADV'], 'link' => '?view=components&do=config&id=' . $id . '&opt=delete_item&item_id=%id%'));
cpListTable('cms_board_items', $fields, $actions, '', 'pubdate DESC');
}
if ($opt == 'add_cat' || $opt == 'edit_cat') {
cpAddPathway($_LANG['AD_ALL_CAT'], '?view=components&do=config&id=' . $id . '&opt=list_cats');
if ($opt == 'add_cat') {
cpAddPathway($_LANG['AD_NEW_CAT']);
} else {
$item_id = cmsCore::request('item_id', 'int', 0);
$mod = cmsCore::c('db')->get_fields('cms_board_cats', "id = '" . $item_id . "'", '*');
if (!$mod) {
cmsCore::error404();
}
echo '<h3>' . $_LANG['AD_CAT_EDIT'] . '</h3>';
cpAddPathway($_LANG['AD_CAT_EDIT'] . ' "' . $mod['title'] . '"');
示例9: applet_cats
//.........这里部分代码省略.........
} else {
$category['photoalbum'] = '';
}
$ns = $inCore->nestedSetsInit('cms_category');
$category['id'] = $ns->AddNode($category['parent_id']);
$category['seolink'] = cmsCore::generateCatSeoLink($category, 'cms_category', $model->config['is_url_cyrillic']);
if ($category['id']) {
$inDB->update('cms_category', $category, $category['id']);
if (!cmsCore::request('is_access', 'int', 0)) {
$showfor = $_REQUEST['showfor'];
cmsCore::setAccess($category['id'], $showfor, 'category');
} else {
cmsCore::clearAccess($category['id'], 'category');
}
}
$inmenu = cmsCore::request('createmenu', 'str', '');
if ($inmenu) {
createMenuItem($inmenu, $category['id'], $category['title']);
}
cmsCore::addSessionMessage($_LANG['AD_CATEGORY_ADD'], 'success');
cmsCore::redirect('?view=tree');
}
if ($do == 'add' || $do == 'edit') {
require '../includes/jwtabs.php';
$GLOBALS['cp_page_head'][] = jwHeader();
$toolmenu = array();
$toolmenu[0]['icon'] = 'save.gif';
$toolmenu[0]['title'] = $_LANG['SAVE'];
$toolmenu[0]['link'] = 'javascript:document.addform.submit();';
$toolmenu[1]['icon'] = 'cancel.gif';
$toolmenu[1]['title'] = $_LANG['CANCEL'];
$toolmenu[1]['link'] = 'javascript:history.go(-1);';
cpToolMenu($toolmenu);
$menu_list = cpGetList('menu');
if ($do == 'add') {
echo '<h3>' . $_LANG['AD_CREATE_SECTION'] . '</h3>';
cpAddPathway($_LANG['AD_CREATE_SECTION'], 'index.php?view=cats&do=add');
$mod['tpl'] = 'com_content_view.tpl';
} else {
if (isset($_REQUEST['multiple'])) {
if (isset($_REQUEST['item'])) {
$_SESSION['editlist'] = $_REQUEST['item'];
} else {
echo '<p class="error">' . $_LANG['AD_NO_SELECT_OBJECTS'] . '</p>';
return;
}
}
$ostatok = '';
if (isset($_SESSION['editlist'])) {
$id = array_shift($_SESSION['editlist']);
if (sizeof($_SESSION['editlist']) == 0) {
unset($_SESSION['editlist']);
} else {
$ostatok = '(' . $_LANG['AD_NEXT_IN'] . sizeof($_SESSION['editlist']) . ')';
}
} else {
$id = (int) $_REQUEST['id'];
}
$sql = "SELECT * FROM cms_category WHERE id = {$id} LIMIT 1";
$result = $inDB->query($sql);
if ($inDB->num_rows($result)) {
$mod = $inDB->fetch_assoc($result);
if (@$mod['photoalbum']) {
$mod['photoalbum'] = unserialize($mod['photoalbum']);
}
}
示例10: applet_modules
//.........这里部分代码省略.........
case 'flag':
$value = cmsCore::request($name, 'int', 0);
break;
case 'list':
$value = is_array($_POST[$name]) ? cmsCore::request($name, 'array_str', $default) : cmsCore::request($name, 'str', $default);
break;
case 'list_function':
$value = cmsCore::request($name, 'str', $default);
break;
case 'list_db':
$value = is_array($_POST[$name]) ? cmsCore::request($name, 'array_str', $default) : cmsCore::request($name, 'str', $default);
break;
}
$cfg[$name] = $value;
}
}
$cfg['tpl'] = cmsCore::request('tpl', 'str', $module_name);
$inCore->saveModuleConfig($id, $cfg);
if (!$is_ajax) {
cmsCore::addSessionMessage($_LANG['AD_CONFIG_SAVE_SUCCESS'], 'success');
}
cmsCore::redirectBack();
}
if ($do == 'list') {
$toolmenu = array(array('icon' => 'new.gif', 'title' => $_LANG['AD_MODULE_ADD'], 'link' => '?view=modules&do=add'), array('icon' => 'install.gif', 'title' => $_LANG['AD_MODULES_SETUP'], 'link' => '?view=install&do=module'), array('icon' => 'edit.gif', 'title' => $_LANG['AD_EDIT_SELECTED'], 'link' => "javascript:checkSel('?view=modules&do=edit&multiple=1');"), array('icon' => 'delete.gif', 'title' => $_LANG['AD_DELETE_SELECTED'], 'link' => "javascript:checkSel('?view=modules&do=delete&multiple=1');"), array('icon' => 'show.gif', 'title' => $_LANG['AD_ALLOW_SELECTED'], 'link' => "javascript:checkSel('?view=modules&do=show&multiple=1');"), array('icon' => 'hide.gif', 'title' => $_LANG['AD_DISALLOW_SELECTED'], 'link' => "javascript:checkSel('?view=modules&do=hide&multiple=1');"), array('icon' => 'autoorder.gif', 'title' => $_LANG['AD_MODULE_ORDER'], 'link' => '?view=modules&do=autoorder'), array('icon' => 'reorder.gif', 'title' => $_LANG['AD_SAVE_ORDER'], 'link' => "javascript:checkSel('?view=modules&do=saveorder');"), array('icon' => 'help.gif', 'title' => $_LANG['AD_HELP'], 'link' => '?view=help&topic=modules'));
cpToolMenu($toolmenu);
$fields = array(array('title' => 'id', 'field' => 'id', 'width' => '40'), array('title' => $_LANG['AD_TITLE'], 'field' => array('title', 'titles'), 'width' => '', 'link' => '?view=modules&do=edit&id=%id%', 'prc' => function ($i) {
$i['titles'] = cmsCore::yamlToArray($i['titles']);
// переопределяем название пункта меню в зависимости от языка
if (!empty($i['titles'][cmsConfig::getConfig('lang')])) {
$i['title'] = $i['titles'][cmsConfig::getConfig('lang')];
}
return $i['title'];
}), array('title' => $_LANG['TITLE'], 'field' => 'name', 'width' => '220', 'filter' => '15'), array('title' => $_LANG['AD_VERSION'], 'field' => 'version', 'width' => '70'), array('title' => $_LANG['AD_AUTHOR'], 'field' => 'author', 'width' => '110'), array('title' => $_LANG['SHOW'], 'field' => 'published', 'width' => '80'), array('title' => $_LANG['AD_ORDER'], 'field' => 'ordering', 'width' => '100'), array('title' => $_LANG['AD_POSITION'], 'field' => 'position', 'width' => '80', 'filter' => '10', 'filterlist' => cpGetList('positions')));
$actions = array(array('title' => $_LANG['AD_CONFIG'], 'icon' => 'config.gif', 'link' => '?view=modules&do=config&id=%id%', 'condition' => 'cpModuleHasConfig'), array('title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '?view=modules&do=edit&id=%id%'), array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_MODULE_DELETE'], 'link' => '?view=modules&do=delete&id=%id%'));
cpListTable('cms_modules', $fields, $actions, '', 'published DESC, position, ordering ASC');
}
if ($do == 'autoorder') {
$rs = cmsCore::c('db')->query("SELECT id, position FROM cms_modules ORDER BY position");
if (cmsCore::c('db')->num_rows($rs)) {
$ord = 1;
while ($item = cmsCore::c('db')->fetch_assoc($rs)) {
if (isset($latest_pos)) {
if ($latest_pos != $item['position']) {
$ord = 1;
}
}
cmsCore::c('db')->query("UPDATE cms_modules SET ordering = " . $ord . " WHERE id=" . $item['id']);
$ord += 1;
$latest_pos = $item['position'];
}
}
cmsCore::redirect('index.php?view=modules');
}
if ($do == 'move_up') {
if ($id >= 0) {
dbMoveUp('cms_modules', $id, $co);
}
cmsCore::redirectBack();
}
if ($do == 'move_down') {
if ($id >= 0) {
dbMoveDown('cms_modules', $id, $co);
}
cmsCore::redirectBack();
}
示例11: applet_menu
function applet_menu()
{
$inCore = cmsCore::getInstance();
global $_LANG;
global $adminAccess;
if (!cmsUser::isAdminCan('admin/menu', $adminAccess)) {
cpAccessDenied();
}
cmsCore::c('page')->setTitle($_LANG['AD_MENU']);
cpAddPathway($_LANG['AD_MENU'], 'index.php?view=menu');
$do = cmsCore::request('do', 'str', 'list');
$id = cmsCore::request('id', 'int', -1);
if ($do == 'list') {
$toolmenu = array(array('icon' => 'new.gif', 'title' => $_LANG['AD_MENU_POINT_ADD'], 'link' => '?view=menu&do=add'), array('icon' => 'newmenu.gif', 'title' => $_LANG['AD_MENU_ADD'], 'link' => '?view=menu&do=addmenu'), array('icon' => 'edit.gif', 'title' => $_LANG['AD_EDIT_SELECTED'], 'link' => "javascript:checkSel('?view=menu&do=edit&multiple=1');"), array('icon' => 'delete.gif', 'title' => $_LANG['AD_DELETE_SELECTED'], 'link' => "javascript:checkSel('?view=menu&do=delete&multiple=1');"), array('icon' => 'show.gif', 'title' => $_LANG['AD_ALLOW_SELECTED'], 'link' => "javascript:checkSel('?view=menu&do=show&multiple=1');"), array('icon' => 'hide.gif', 'title' => $_LANG['AD_DISALLOW_SELECTED'], 'link' => "javascript:checkSel('?view=menu&do=hide&multiple=1');"), array('icon' => 'help.gif', 'title' => $_LANG['AD_HELP'], 'link' => '?view=help&topic=menu'));
cpToolMenu($toolmenu);
$fields = array(array('title' => 'Lt', 'field' => 'NSLeft', 'width' => '40'), array('title' => $_LANG['TITLE'], 'field' => array('title', 'titles'), 'width' => '', 'link' => '?view=menu&do=edit&id=%id%', 'prc' => function ($i) {
$i['titles'] = cmsCore::yamlToArray($i['titles']);
// переопределяем название пункта меню в зависимости от языка
if (!empty($i['titles'][cmsConfig::getConfig('lang')])) {
$i['title'] = $i['titles'][cmsConfig::getConfig('lang')];
}
return $i['title'];
}), array('title' => $_LANG['SHOW'], 'field' => 'published', 'width' => '80'), array('title' => $_LANG['AD_ORDER'], 'field' => 'ordering', 'width' => '100'), array('title' => $_LANG['AD_LINK'], 'field' => array('linktype', 'linkid', 'link'), 'width' => '240', 'prc' => 'cpMenutypeById'), array('title' => $_LANG['AD_MENU'], 'field' => 'menu', 'width' => '80', 'filter' => '10', 'filterlist' => cpGetList('menu'), 'prc' => 'list_menu'), array('title' => $_LANG['TEMPLATE'], 'field' => 'template', 'width' => '90', 'prc' => 'cpTemplateById'));
$actions = array(array('title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '?view=menu&do=edit&id=%id%'), array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_MENU_POINT_CONFIRM'], 'link' => '?view=menu&do=delete&id=%id%'));
cpListTable('cms_menu', $fields, $actions, 'parent_id>0', 'NSLeft, ordering');
} else {
$toolmenu = array(array('icon' => 'save.gif', 'title' => $_LANG['SAVE'], 'link' => 'javascript:document.addform.submit();'), array('icon' => 'cancel.gif', 'title' => $_LANG['CANCEL'], 'link' => 'index.php?view=menu'));
cpToolMenu($toolmenu);
}
if ($do == 'move_up') {
cmsCore::c('db')->moveNsCategory('cms_menu', $id, 'up');
cmsCore::redirectBack();
}
if ($do == 'move_down') {
cmsCore::c('db')->moveNsCategory('cms_menu', $id, 'down');
cmsCore::redirectBack();
}
if ($do == 'show') {
if (!cmsCore::inRequest('item')) {
if ($id >= 0) {
cmsCore::c('db')->setFlag('cms_menu', $id, 'published', '1');
}
cmsCore::halt('1');
} else {
cmsCore::c('db')->setFlags('cms_menu', $_REQUEST['item'], 'published', '1');
cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
cmsCore::redirectBack();
}
}
if ($do == 'hide') {
if (!cmsCore::inRequest('item')) {
if ($id >= 0) {
cmsCore::c('db')->setFlag('cms_menu', $id, 'published', '0');
}
cmsCore::halt('1');
} else {
cmsCore::c('db')->setFlags('cms_menu', cmsCore::request('item', 'array_int', array()), 'published', '0');
cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
cmsCore::redirectBack();
}
}
if ($do == 'delete') {
if (!cmsCore::inRequest('item')) {
if ($id >= 0) {
cmsCore::c('db')->deleteNS('cms_menu', (int) $id);
}
} else {
cmsCore::c('db')->deleteListNS('cms_menu', cmsCore::request('item', 'array_int', array()));
}
cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
cmsCore::redirectBack();
}
if ($do == 'update') {
if (!cmsUser::checkCsrfToken()) {
cmsCore::error404();
}
$id = cmsCore::request('id', 'int', 0);
if (!$id) {
cmsCore::redirectBack();
}
$title = cmsCore::request('title', 'str', '');
$titles = cmsCore::arrayToYaml(cmsCore::request('titles', 'array_str', array()));
$menu = cmsCore::arrayToYaml(cmsCore::request('menu', 'array_str', ''));
$linktype = cmsCore::request('mode', 'str', '');
$linkid = cmsCore::request($linktype, 'str', '');
$link = $inCore->getMenuLink($linktype, $linkid);
$target = cmsCore::request('target', 'str', '');
$published = cmsCore::request('published', 'int', 0);
$template = cmsCore::request('template', 'str', '');
$iconurl = cmsCore::request('iconurl', 'str', '');
$parent_id = cmsCore::request('parent_id', 'int', 0);
$oldparent = cmsCore::request('oldparent', 'int', 0);
$is_lax = cmsCore::request('is_lax', 'int', 0);
$css_class = cmsCore::request('css_class', 'str', '');
$is_public = cmsCore::request('is_public', 'int', '');
if (!$is_public) {
$access_list = cmsCore::arrayToYaml(cmsCore::request('allow_group', 'array_int'));
}
$ns = $inCore->nestedSetsInit('cms_menu');
if ($oldparent != $parent_id) {
//.........这里部分代码省略.........
示例12: array
echo '<h3>' . $_LANG['AD_CATALOG_RUBRICS'] . '</h3>';
$fields = array(array('title' => 'id', 'field' => 'id', 'width' => '40'), array('title' => $_LANG['TITLE'], 'field' => 'title', 'width' => '', 'link' => '?view=components&do=config&id=' . $id . '&opt=edit_cat&item_id=%id%'), array('title' => $_LANG['AD_PARENT'], 'field' => 'parent_id', 'width' => '200', 'prc' => 'cpCatalogCatById'), array('title' => $_LANG['AD_IS_PUBLISHED'], 'field' => 'published', 'width' => '100', 'do' => 'opt', 'do_suffix' => '_cat'));
$actions = array(array('title' => $_LANG['AD_CONTENT_VIEW'], 'icon' => 'explore.gif', 'link' => 'javascript:openCat(%id%)'), array('title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '?view=components&do=config&id=' . $id . '&opt=edit_cat&item_id=%id%'), array('title' => $_LANG['AD_DO_COPY'], 'icon' => 'copy.gif', 'link' => "javascript:copyCat(" . $id . ", %id%);"), array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_IF_RUBRIC_DELETE'], 'link' => '?view=components&do=config&id=' . $id . '&opt=delete_cat&item_id=%id%'));
echo '<script type="text/javascript">function openCat(id){ $("#catform input").val(id); $("#catform").submit(); } </script>';
echo '<form id="catform" method="post" action="index.php?view=components&do=config&id=' . $id . '&opt=list_items"><input type="hidden" id="filter[category_id]" name="filter[category_id]" value=""></form>';
cpListTable('cms_uc_cats', $fields, $actions, 'parent_id>0', 'NSLeft');
}
if ($opt == 'list_items') {
cmsCore::c('page')->addHeadJS('admin/components/catalog/js/common.js');
cpAddPathway($_LANG['AD_ITEMS']);
if (cmsCore::inRequest('on_moderate')) {
echo '<h3>' . $_LANG['AD_ITEMS_TO_MODERATION'] . '</h3>';
} else {
echo '<h3>' . $_LANG['AD_ITEMS'] . '</h3>';
}
$fields = array(array('title' => 'id', 'field' => 'id', 'width' => '40'), array('title' => $_LANG['TITLE'], 'field' => 'title', 'width' => '', 'link' => cmsCore::inRequest('on_moderate') ? '/catalog/item%id%.html' : '/catalog/edit%id%.html', 'filter' => 15), array('title' => $_LANG['AD_IS_PUBLISHED'], 'field' => 'published', 'width' => '100', 'do' => 'opt', 'do_suffix' => '_item'), array('title' => $_LANG['AD_CAT_BOARD'], 'field' => 'category_id', 'width' => '200', 'prc' => 'cpCatalogCatById', 'filter' => 1, 'filterlist' => cpGetList('cms_uc_cats')), array('title' => $_LANG['PRICE'], 'field' => array('id', 'category_id', 'price'), 'width' => '150', 'prc' => 'cpPriceInput'));
$actions = array(array('title' => $_LANG['AD_NEW_CALENDAR_DATA'], 'icon' => 'date.gif', 'link' => '?view=components&do=config&id=' . $id . '&opt=renew_item&item_id=%id%'), array('title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '/catalog/edit%id%.html'), array('title' => $_LANG['AD_DO_COPY'], 'icon' => 'copy.gif', 'link' => "javascript:copyItem(" . $id . ", %id%);"), array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_IF_ITEM_DELETE'], 'link' => '?view=components&do=config&id=' . $id . '&opt=delete_item&item_id=%id%'));
if (cmsCore::inRequest('on_moderate')) {
$where = 'on_moderate=1';
} else {
$where = '';
}
cpListTable('cms_uc_items', $fields, $actions, $where);
}
if ($opt == 'list_discount') {
cpAddPathway($_LANG['AD_COEFFICIENTS']);
echo '<h3>' . $_LANG['AD_COEFFICIENTS'] . '</h3>';
$fields = array(array('title' => 'id', 'field' => 'id', 'width' => '40'), array('title' => $_LANG['TITLE'], 'field' => 'title', 'width' => '', 'link' => '?view=components&do=config&id=' . $id . '&opt=edit_discount&item_id=%id%'), array('title' => $_LANG['AD_CAT_BOARD'], 'field' => 'cat_id', 'width' => '200', 'prc' => 'cpCatalogCatById'), array('title' => $_LANG['AD_TYPE'], 'field' => 'sign', 'width' => '40'), array('title' => $_LANG['AD_SIZE'], 'field' => 'value', 'width' => '80'), array('title' => $_LANG['AD_UNITS'], 'field' => 'unit', 'width' => '80'), array('title' => $_LANG['AD_LIMIT'], 'field' => 'if_limit', 'width' => '80'));
$actions = array(array('title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '?view=components&do=config&id=' . $id . '&opt=edit_discount&item_id=%id%'), array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_IF_COEFFICIENT_DELETE'], 'link' => '?view=components&do=config&id=' . $id . '&opt=delete_discount&item_id=%id%'));
cpListTable('cms_uc_discount', $fields, $actions);
}
示例13: applet_cats
//.........这里部分代码省略.........
$category['seolink'] = cmsCore::generateCatSeoLink($category, 'cms_category', cmsCore::m('content')->config['is_url_cyrillic']);
if ($category['id']) {
cmsCore::c('db')->update('cms_category', $category, $category['id']);
if (!cmsCore::request('is_access', 'int', 0)) {
$showfor = cmsCore::request('showfor', 'array_int');
cmsCore::setAccess($category['id'], $showfor, 'category');
} else {
cmsCore::clearAccess($category['id'], 'category');
}
}
$inmenu = cmsCore::request('createmenu', 'str', '');
if ($inmenu) {
createMenuItem($inmenu, $category['id'], $category['title']);
}
cmsCore::addSessionMessage($_LANG['AD_CATEGORY_ADD'], 'success');
cmsCore::redirect('?view=tree');
}
if ($do == 'add' || $do == 'edit') {
$toolmenu = array(
array( 'icon' => 'save.gif', 'title' => $_LANG['SAVE'], 'link' => 'javascript:document.addform.submit();' ),
array( 'icon' => 'cancel.gif', 'title' => $_LANG['CANCEL'], 'link' => 'javascript:history.go(-1);' ),
);
cpToolMenu($toolmenu);
$menu_list = cpGetList('menu');
if ($do == 'add') {
echo '<h3>'. $_LANG['AD_CREATE_SECTION'] .'</h3>';
cpAddPathway($_LANG['AD_CREATE_SECTION'], 'index.php?view=cats&do=add');
$mod = array();
$mod['tpl'] = 'com_content_view';
} else {
if (cmsCore::inRequest('multiple')) {
if (cmsCore::inRequest('item')) {
$_SESSION['editlist'] = cmsCore::request('item', 'array_int');
} else {
echo '<p class="error">'. $_LANG['AD_NO_SELECT_OBJECTS'] .'</p>';
return;
}
}
$ostatok = '';
if (isset($_SESSION['editlist'])) {
$id = array_shift($_SESSION['editlist']);
if (sizeof($_SESSION['editlist']) == 0) {
unset($_SESSION['editlist']);
} else {
$ostatok = '('. $_LANG['AD_NEXT_IN'] . sizeof($_SESSION['editlist']) .')';
}
} else {
$id = cmsCore::request('id', 'int', 0);
}
$mod = cmsCore::c('db')->get_fields('cms_category', 'id='.$id, '*');
示例14: cpGetList
$fields[2]['filter'] = 15;
$fields[2]['link'] = '?view=components&do=config&id=' . $_REQUEST['id'] . '&opt=edit_photo&item_id=%id%';
$fields[3]['title'] = 'Показ';
$fields[3]['field'] = 'published';
$fields[3]['width'] = '100';
$fields[3]['do'] = 'opt';
$fields[3]['do_suffix'] = '_photo';
$fields[4]['title'] = 'Просмотров';
$fields[4]['field'] = 'hits';
$fields[4]['width'] = '90';
$fields[5]['title'] = 'Альбом';
$fields[5]['field'] = 'album_id';
$fields[5]['width'] = '250';
$fields[5]['prc'] = 'cpPhotoAlbumById';
$fields[5]['filter'] = 1;
$fields[5]['filterlist'] = cpGetList('cms_photo_albums');
//ACTIONS
$actions = array();
$actions[0]['title'] = 'Редактировать';
$actions[0]['icon'] = 'edit.gif';
$actions[0]['link'] = '?view=components&do=config&id=' . $_REQUEST['id'] . '&opt=edit_photo&item_id=%id%';
$actions[1]['title'] = 'Удалить';
$actions[1]['icon'] = 'delete.gif';
$actions[1]['confirm'] = 'Удалить фотографию?';
$actions[1]['link'] = '?view=components&do=config&id=' . $_REQUEST['id'] . '&opt=delete_photo&item_id=%id%';
//Print table
cpListTable('cms_photo_files', $fields, $actions, '', 'id DESC');
}
//=================================================================================================//
//=================================================================================================//
if ($opt == 'add_album' || $opt == 'edit_album') {
示例15: array
$fields = array();
$fields[0]['title'] = 'id';
$fields[0]['field'] = 'id';
$fields[0]['width'] = '30';
$fields[1]['title'] = $_LANG['AD_QUESTION'];
$fields[1]['field'] = 'quest';
$fields[1]['width'] = '';
$fields[1]['link'] = '?view=components&do=config&id=' . (int) $_REQUEST['id'] . '&opt=edit_item&item_id=%id%';
$fields[1]['filter'] = 15;
$fields[1]['maxlen'] = 80;
$fields[2]['title'] = $_LANG['AD_CATEGORY'];
$fields[2]['field'] = 'category_id';
$fields[2]['width'] = '300';
$fields[2]['prc'] = 'cpFaqCatById';
$fields[2]['filter'] = 1;
$fields[2]['filterlist'] = cpGetList('cms_faq_cats');
$fields[3]['title'] = $_LANG['AD_SHOW'];
$fields[3]['field'] = 'published';
$fields[3]['width'] = '100';
$fields[3]['do'] = 'opt';
$fields[3]['do_suffix'] = '_item';
//ACTIONS
$actions = array();
$actions[0]['title'] = $_LANG['EDIT'];
$actions[0]['icon'] = 'edit.gif';
$actions[0]['link'] = '?view=components&do=config&id=' . (int) $_REQUEST['id'] . '&opt=edit_item&item_id=%id%';
$actions[1]['title'] = $_LANG['DELETE'];
$actions[1]['icon'] = 'delete.gif';
$actions[1]['confirm'] = $_LANG['AD_REMOVE_QUESTION'];
$actions[1]['link'] = '?view=components&do=config&id=' . (int) $_REQUEST['id'] . '&opt=delete_item&item_id=%id%';
//Print table