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


PHP SEC_getGroupDropdown函数代码示例

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


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

示例1: showForm

 /**
  *  Creates the edit form.
  *
  *  @param  integer $id Optional ID, current record used if zero
  *  @return string      HTML for edit form
  */
 public function showForm()
 {
     global $_TABLES, $_CONF, $_PP_CONF, $LANG_PP;
     $T = new Template(PAYPAL_PI_PATH . '/templates');
     $T->set_file(array('category' => 'category_form.thtml'));
     $id = $this->cat_id;
     // If we have a nonzero category ID, then we edit the existing record.
     // Otherwise, we're creating a new item.  Also set the $not and $items
     // values to be used in the parent category selection accordingly.
     if ($id > 0) {
         //if (!$this->Read($id)) {
         //    return PAYPAL_errorMessage($LANG_PP['invalid_category_id'], 'info');
         //}
         //$id = $this->cat_id;
         $retval = COM_startBlock($LANG_PP['edit'] . ': ' . $this->cat_name);
         $T->set_var('cat_id', $id);
         $not = 'NOT';
         $items = $id;
     } else {
         //$id = $this->cat_id;
         $retval = COM_startBlock($LANG_PP['create_category']);
         $T->set_var('cat_id', '');
         $not = '';
         $items = '';
     }
     $T->set_var(array('site_url' => $_CONF['site_url'], 'action_url' => PAYPAL_ADMIN_URL, 'pi_url' => PAYPAL_URL, 'cat_name' => $this->cat_name, 'description' => $this->description, 'ena_chk' => $this->enabled == 1 ? 'checked="checked"' : '', 'parent_sel' => PAYPAL_recurseCats('PAYPAL_callbackCatOptionList', $this->parent_id, 0, '', $not, $items), 'permissions_editor' => SEC_getPermissionsHTML($this->perm_owner, $this->perm_group, $this->perm_members, $this->perm_anon), 'group_sel' => SEC_getGroupDropdown($this->group_id, 3), 'owner_sel' => COM_optionList($_TABLES['users'], 'uid,username', $this->owner_id, 1)));
     if ($this->image != '') {
         $T->set_var('img_url', PAYPAL_PI_URL . '/images/categories/' . $this->image);
     }
     if (!$this->isUsed()) {
         $T->set_var('can_delete', 'true');
     }
     /*
             // Might want this later to set default buttons per category
             $T->set_block('product', 'BtnRow', 'BRow');
             foreach ($LANG_PP['buttons'] as $key=>$value) {
                 $T->set_var(array(
                     'btn_type'  => $key,
                     'btn_chk'   => isset($this->buttons[$key]) ? 
                                     'checked="checked"' : '',
                     'btn_name'  => $value,
                 ));
                 $T->parse('BRow', 'BtnRow', true);
             }*/
     if ($this->image != '') {
         $T->set_var('img_url', PAYPAL_URL . '/images/categories/' . $this->image);
         $T->set_var('del_img_url', PAYPAL_ADMIN_URL . '/index.php?action=delete_img&img_id=' . $prow['img_id'] . '&id=' . $this->id);
     }
     $retval .= $T->parse('output', 'category');
     @setcookie($_CONF['cookie_name'] . 'fckeditor', SEC_createTokenGeneral('advancededitor'), time() + 1200, $_CONF['cookie_path'], $_CONF['cookiedomain'], $_CONF['cookiesecure']);
     $retval .= COM_endBlock();
     return $retval;
 }
开发者ID:NewRoute,项目名称:paypal,代码行数:59,代码来源:category.class.php

示例2: showEditor

 /**
  * Show the category editor
  */
 function showEditor($cid, $mode = 'edit')
 {
     global $_CONF, $_TABLES, $_USER, $LANG_ACCESS, $_DLM_CONF, $LANG_DLM, $mytree;
     $retval = '';
     if (!empty($this->_editor_mode)) {
         $mode = $this->_editor_mode;
     } else {
         $this->_editor_mode = $mode;
     }
     if ($mode == 'edit' || $mode == 'clone') {
         if ($this->_retry == true) {
             $this->_loadFromArgs($_POST);
         } else {
             $this->_loadFromDatabase($cid);
         }
     }
     if ($mode == 'clone') {
         $this->_cid = $this->_createID($this->_cid . '_');
         $this->_old_cid = $this->_cid;
     }
     if ($mode == 'create') {
         if ($this->_retry == true) {
             $this->_loadFromArgs($_POST);
         } else {
             $this->_initVars();
         }
     }
     $this->_checkHasAccess();
     $blocktitle = $mode == 'edit' ? $LANG_DLM['modcat'] : $LANG_DLM['addcat'];
     $retval .= $this->_showMessage();
     $retval .= COM_startBlock($blocktitle, '', COM_getBlockTemplate('_admin_block', 'header'));
     $T = new Template($_DLM_CONF['path_layout']);
     $T->set_file(array('t_modcategory' => 'admin_modcategory.thtml', 't_admin_access' => 'admin_access.thtml', 't_admin_submit_delete' => 'admin_submit_delete.thtml'));
     DLM_setDefaultTemplateVars($T);
     $lang = array('title', 'imgurlmain', 'parent', 'save', 'delete', 'cancel', 'confirm_delete', 'topic', 'catid', 'is_enabled', 'corder', 'upload');
     foreach ($lang as $v) {
         $T->set_var('lang_' . $v, $LANG_DLM[$v]);
     }
     $T->set_var('preview', $this->_makeForm_category_image());
     $T->set_var('imgurl', $this->_imgurl);
     $T->set_var('imgurlold', $this->_imgurl);
     $T->set_var('cid', $this->_cid);
     $T->set_var('old_cid', $this->_old_cid);
     $T->set_var('corder', $this->_corder);
     $T->set_var('title', $this->_title);
     $T->set_var('op', $mode == 'edit' ? 'saveCategory' : 'addCategory');
     $T->set_var('delete_disabled', $mode == 'edit' ? '' : UC_DISABLED);
     $T->set_var('val_is_enabled', $this->_is_enabled == 1 ? UC_CHECKED : '');
     $T->set_var('selparents', $mytree->makeSelBox('title', 'corder', $this->_pid, 1, 'pid', '', $this->_cid));
     // user access info
     $lang = array('accessrights', 'owner', 'group', 'permissions', 'permissionskey', 'permmsg');
     foreach ($lang as $v) {
         $T->set_var('lang_' . $v, $LANG_ACCESS[$v]);
     }
     $this->_owner_id = (int) $this->_owner_id;
     $T->set_var('owner_username', DB_getItem($_TABLES['users'], 'username', "uid = {$this->_owner_id}"));
     $ownername = COM_getDisplayName($this->_owner_id);
     $T->set_var('owner_name', $ownername);
     $T->set_var('owner', $ownername);
     $T->set_var('ownerid', $this->_owner_id);
     $T->set_var('group_dropdown', SEC_getGroupDropdown($this->_group_id, 3));
     $T->set_var('permissions_editor', SEC_getPermissionsHTML($this->_perm_owner, $this->_perm_group, $this->_perm_members, $this->_perm_anon));
     $hidden_values = $this->_makeForm_hidden('editor_mode', $this->_editor_mode);
     $T->set_var('hidden_values', $hidden_values);
     $T->parse('admin_access', 't_admin_access');
     if ($mode == 'edit') {
         $T->parse('admin_submit_delete', 't_admin_submit_delete');
     }
     $T->set_var('gltoken_name', CSRF_TOKEN);
     $T->set_var('gltoken', SEC_createToken());
     $T->parse('output', 't_modcategory');
     $retval .= $T->finish($T->get_var('output'));
     $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
     $retval = DLM_createHTMLDocument($retval, array('pagetitle' => $blocktitle));
     return $retval;
 }
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:79,代码来源:category.class.php

示例3: links_edit_category


//.........这里部分代码省略.........
        $result = DB_query($sql);
        $A = DB_fetchArray($result);
    } else {
        // nothing, so making a new top-level category
        // get default access rights
        $A['group_id'] = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name='Links Admin'");
        SEC_setDefaultPermissions($A, $_LI_CONF['category_permissions']);
        $A['owner_id'] = $_USER['uid'];
        $A['pid'] = $_LI_CONF['root'];
    }
    $access = SEC_hasAccess($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']);
    if ($access < 3) {
        return COM_showMessage(6, 'links');
    }
    $token = SEC_createToken();
    $retval .= COM_startBlock($LANG_LINKS_ADMIN[56], '', COM_getBlockTemplate('_admin_block', 'header'));
    $retval .= SEC_getTokenExpiryNotice($token);
    $T = new Template($_CONF['path'] . 'plugins/links/templates/admin');
    $T->set_file(array('page' => 'categoryeditor.thtml'));
    $T->set_var('xhtml', XHTML);
    $T->set_var('site_url', $_CONF['site_url']);
    $T->set_var('site_admin_url', $_CONF['site_admin_url']);
    $T->set_var('layout_url', $_CONF['layout_url']);
    $T->set_var('lang_pagetitle', $LANG_LINKS_ADMIN[28]);
    $T->set_var('lang_link_list', $LANG_LINKS_ADMIN[53]);
    $T->set_var('lang_new_link', $LANG_LINKS_ADMIN[51]);
    $T->set_var('lang_validate_links', $LANG_LINKS_ADMIN[26]);
    $T->set_var('lang_list_categories', $LANG_LINKS_ADMIN[50]);
    $T->set_var('lang_new_category', $LANG_LINKS_ADMIN[52]);
    $T->set_var('lang_admin_home', $LANG_ADMIN['admin_home']);
    $T->set_var('instructions', $LANG_LINKS_ADMIN[29]);
    $T->set_var('lang_category', $LANG_LINKS_ADMIN[30]);
    $T->set_var('lang_cid', $LANG_LINKS_ADMIN[32]);
    $T->set_var('lang_description', $LANG_LINKS_ADMIN[31]);
    $T->set_var('lang_topic', $LANG_LINKS_ADMIN[33]);
    $T->set_var('lang_parent', $LANG_LINKS_ADMIN[34]);
    $T->set_var('lang_save', $LANG_ADMIN['save']);
    if (!empty($cid)) {
        $delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete'] . '" name="mode"%s' . XHTML . '>';
        $jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"';
        $T->set_var('delete_option', sprintf($delbutton, $jsconfirm));
        $T->set_var('delete_option_no_confirmation', sprintf($delbutton, ''));
    } else {
        $T->set_var('delete_option', '');
    }
    $T->set_var('lang_cancel', $LANG_ADMIN['cancel']);
    if (!empty($cid)) {
        $T->set_var('cid_value', $A['cid']);
        $T->set_var('old_cid_value', $A['cid']);
        $T->set_var('category_options', links_select_box(3, $A['pid']));
        $T->set_var('category_value', $A['category']);
        $T->set_var('description_value', $A['description']);
    } else {
        $A['cid'] = COM_makeSid();
        $T->set_var('cid_value', $A['cid']);
        $T->set_var('old_cid_value', '');
        $T->set_var('category_options', links_select_box(3, $A['pid']));
        $T->set_var('category_value', '');
        $T->set_var('description_value', '');
    }
    if (!isset($A['tid'])) {
        $A['tid'] = 'all';
    }
    $topics = COM_topicList('tid,topic', $A['tid'], 1, true);
    $T->set_var('topic_list', $topics);
    $alltopics = '<option value="all"';
    if ($A['tid'] == 'all') {
        $alltopics .= ' selected="selected"';
    }
    $alltopics .= '>' . $LANG_LINKS_ADMIN[35] . '</option>' . LB;
    $T->set_var('topic_selection', '<select name="tid">' . $alltopics . $topics . '</select>');
    if (empty($cid)) {
        $num_links = $LANG_ADMIN['na'];
    } else {
        $nresult = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['links']} WHERE cid='{$cid}'" . COM_getPermSQL('AND'));
        $N = DB_fetchArray($nresult);
        $num_links = COM_numberFormat($N['count']);
    }
    $T->set_var('lang_num_links', $LANG_LINKS_ADMIN[61]);
    $T->set_var('num_links', $num_links);
    // user access info
    $T->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
    $T->set_var('lang_owner', $LANG_ACCESS['owner']);
    $T->set_var('owner_name', COM_getDisplayName($A['owner_id']));
    $T->set_var('cat_ownerid', $A['owner_id']);
    $T->set_var('lang_group', $LANG_ACCESS['group']);
    $T->set_var('group_dropdown', SEC_getGroupDropdown($A['group_id'], $access));
    $T->set_var('lang_permissions', $LANG_ACCESS['permissions']);
    $T->set_var('lang_permissionskey', $LANG_ACCESS['permissionskey']);
    $T->set_var('lang_perm_key', $LANG_ACCESS['permissionskey']);
    $T->set_var('permissions_editor', SEC_getPermissionsHTML($A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']));
    $T->set_var('lang_permissions_msg', $LANG_ACCESS['permmsg']);
    $T->set_var('lang_lockmsg', $LANG_ACCESS['permmsg']);
    $T->set_var('gltoken_name', CSRF_TOKEN);
    $T->set_var('gltoken', $token);
    $T->parse('output', 'page');
    $retval .= $T->finish($T->get_var('output'));
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:101,代码来源:category.php

示例4: staticpageeditor_form


//.........这里部分代码省略.........
    }
    $sp_template->set_var('lang_mode', $LANG24[3]);
    $sp_template->set_var('comment_options', COM_optionList($_TABLES['commentcodes'], 'code,name', $A['commentcode']));
    $sp_template->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
    $sp_template->set_var('lang_owner', $LANG_ACCESS['owner']);
    $owner_name = COM_getDisplayName($A['owner_id']);
    $owner_username = DB_getItem($_TABLES['users'], 'username', "uid = {$A['owner_id']}");
    $sp_template->set_var('owner_id', $A['owner_id']);
    $sp_template->set_var('owner', $owner_name);
    $sp_template->set_var('owner_name', $owner_name);
    $sp_template->set_var('owner_username', $owner_username);
    if ($A['owner_id'] > 1) {
        $profile_link = $_CONF['site_url'] . '/users.php?mode=profile&amp;uid=' . $A['owner_id'];
        $sp_template->set_var('start_owner_anchortag', '<a href="' . $profile_link . '">');
        $sp_template->set_var('end_owner_anchortag', '</a>');
        $sp_template->set_var('owner_link', COM_createLink($owner_name, $profile_link));
        $photo = '';
        if ($_CONF['allow_user_photo']) {
            $photo = DB_getItem($_TABLES['users'], 'photo', "uid = {$A['owner_id']}");
            if (!empty($photo)) {
                $camera_icon = '<img src="' . $_CONF['layout_url'] . '/images/smallcamera.' . $_IMAGE_TYPE . '" alt=""' . XHTML . '>';
                $sp_template->set_var('camera_icon', COM_createLink($camera_icon, $profile_link));
            }
        }
        if (empty($photo)) {
            $sp_template->set_var('camera_icon', '');
        }
    } else {
        $sp_template->set_var('start_owner_anchortag', '');
        $sp_template->set_var('end_owner_anchortag', '');
        $sp_template->set_var('owner_link', $owner_name);
    }
    $sp_template->set_var('lang_group', $LANG_ACCESS['group']);
    $sp_template->set_var('group_dropdown', SEC_getGroupDropdown($A['group_id'], $access));
    $sp_template->set_var('permissions_editor', SEC_getPermissionsHTML($A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']));
    $sp_template->set_var('lang_permissions', $LANG_ACCESS['permissions']);
    $sp_template->set_var('lang_perm_key', $LANG_ACCESS['permissionskey']);
    $sp_template->set_var('permissions_msg', $LANG_ACCESS['permmsg']);
    $sp_template->set_var('lang_permissions_msg', $LANG_ACCESS['permmsg']);
    $token = SEC_createToken();
    $start_block = COM_startBlock($LANG_STATIC['staticpageeditor'], '', COM_getBlockTemplate('_admin_block', 'header'));
    $start_block .= SEC_getTokenExpiryNotice($token);
    $sp_template->set_var('start_block_editor', $start_block);
    $sp_template->set_var('lang_save', $LANG_ADMIN['save']);
    $sp_template->set_var('lang_cancel', $LANG_ADMIN['cancel']);
    $sp_template->set_var('lang_preview', $LANG_ADMIN['preview']);
    if (SEC_hasRights('staticpages.delete') && $mode != 'clone' && !empty($A['sp_old_id'])) {
        $delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete'] . '" name="mode"%s' . XHTML . '>';
        $jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"';
        $sp_template->set_var('delete_option', sprintf($delbutton, $jsconfirm));
        $sp_template->set_var('delete_option_no_confirmation', sprintf($delbutton, ''));
    } else {
        $sp_template->set_var('delete_option', '');
    }
    $sp_template->set_var('lang_writtenby', $LANG_STATIC['writtenby']);
    $sp_template->set_var('username', DB_getItem($_TABLES['users'], 'username', "uid = {$A['owner_id']}"));
    $authorname = COM_getDisplayName($A['owner_id']);
    $sp_template->set_var('name', $authorname);
    $sp_template->set_var('author', $authorname);
    $sp_template->set_var('lang_url', $LANG_STATIC['url']);
    $sp_template->set_var('lang_id', $LANG_STATIC['id']);
    $sp_template->set_var('sp_uid', $A['owner_id']);
    $sp_template->set_var('sp_id', $A['sp_id']);
    $sp_template->set_var('sp_old_id', $A['sp_old_id']);
    $sp_template->set_var('example_url', COM_buildURL($_CONF['site_url'] . '/staticpages/index.php?page=' . $A['sp_id']));
    $sp_template->set_var('lang_centerblock', $LANG_STATIC['centerblock']);
开发者ID:milk54,项目名称:geeklog-japan,代码行数:67,代码来源:index.php

示例5: edittopic

/**
* Show topic administration form
*
* @param    string  tid     ID of topic to edit
* @return   string          HTML for the topic editor
*
*/
function edittopic($tid = '')
{
    global $_CONF, $_GROUPS, $_TABLES, $_USER, $LANG27, $LANG_ACCESS, $LANG_ADMIN, $MESSAGE;
    $retval = '';
    if (empty($tid)) {
        // new topic - set defaults
        $A = array();
        $A['tid'] = '';
        $A['topic'] = '';
        $A['sortnum'] = 0;
        $A['limitnews'] = '';
        // leave empty!
        $A['is_default'] = 0;
        $A['archive_flag'] = 0;
    } else {
        $result = DB_query("SELECT * FROM {$_TABLES['topics']} WHERE tid ='{$tid}'");
        $A = DB_fetchArray($result);
        $access = SEC_hasAccess($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']);
        if ($access == 0 or $access == 2) {
            $retval .= COM_startBlock($LANG27[12], '', COM_getBlockTemplate('_msg_block', 'header'));
            $retval .= $LANG27[13];
            $retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
            COM_accessLog("User {$_USER['username']} tried to illegally create or edit topic {$tid}.");
            return $retval;
        }
    }
    $token = SEC_createToken();
    $retval .= COM_startBlock($LANG27[1], '', COM_getBlockTemplate('_admin_block', 'header'));
    $retval .= SEC_getTokenExpiryNotice($token);
    if (!is_array($A) || empty($A['owner_id'])) {
        $A['owner_id'] = $_USER['uid'];
        // this is the one instance where we default the group
        // most topics should belong to the Topic Admin group
        if (isset($_GROUPS['Topic Admin'])) {
            $A['group_id'] = $_GROUPS['Topic Admin'];
        } else {
            $A['group_id'] = SEC_getFeatureGroup('topic.edit');
        }
        SEC_setDefaultPermissions($A, $_CONF['default_permissions_topic']);
        $access = 3;
    }
    $topic_templates = new Template($_CONF['path_layout'] . 'admin/topic');
    $topic_templates->set_file('editor', 'topiceditor.thtml');
    $topic_templates->set_var('xhtml', XHTML);
    $topic_templates->set_var('site_url', $_CONF['site_url']);
    $topic_templates->set_var('site_admin_url', $_CONF['site_admin_url']);
    $topic_templates->set_var('layout_url', $_CONF['layout_url']);
    if (!empty($tid) && SEC_hasRights('topic.edit')) {
        $delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete'] . '" name="mode"%s' . XHTML . '>';
        $jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"';
        $topic_templates->set_var('delete_option', sprintf($delbutton, $jsconfirm));
        $topic_templates->set_var('delete_option_no_confirmation', sprintf($delbutton, ''));
        $topic_templates->set_var('warning_msg', $LANG27[6]);
    }
    $topic_templates->set_var('lang_topicid', $LANG27[2]);
    $topic_templates->set_var('topic_id', $A['tid']);
    $topic_templates->set_var('lang_donotusespaces', $LANG27[5]);
    $topic_templates->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
    $topic_templates->set_var('lang_owner', $LANG_ACCESS['owner']);
    $ownername = COM_getDisplayName($A['owner_id']);
    $topic_templates->set_var('owner_username', DB_getItem($_TABLES['users'], 'username', "uid = {$A['owner_id']}"));
    $topic_templates->set_var('owner_name', $ownername);
    $topic_templates->set_var('owner', $ownername);
    $topic_templates->set_var('owner_id', $A['owner_id']);
    $topic_templates->set_var('lang_group', $LANG_ACCESS['group']);
    $topic_templates->set_var('lang_save', $LANG_ADMIN['save']);
    $topic_templates->set_var('lang_cancel', $LANG_ADMIN['cancel']);
    $topic_templates->set_var('group_dropdown', SEC_getGroupDropdown($A['group_id'], $access));
    $topic_templates->set_var('lang_permissions', $LANG_ACCESS['permissions']);
    $topic_templates->set_var('lang_permissions_key', $LANG_ACCESS['permissionskey']);
    $topic_templates->set_var('lang_perm_key', $LANG_ACCESS['permissionskey']);
    $topic_templates->set_var('permissions_msg', $LANG_ACCESS['permmsg']);
    $topic_templates->set_var('lang_permissions_msg', $LANG_ACCESS['permmsg']);
    $topic_templates->set_var('permissions_editor', SEC_getPermissionsHTML($A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']));
    // show sort order only if they specified sortnum as the sort method
    if ($_CONF['sortmethod'] != 'alpha') {
        $topic_templates->set_var('lang_sortorder', $LANG27[10]);
        if ($A['sortnum'] == 0) {
            $A['sortnum'] = '';
        }
        $topic_templates->set_var('sort_order', '<input type="text" size="3" maxlength="3" name="sortnum" value="' . $A['sortnum'] . '"' . XHTML . '>');
    } else {
        $topic_templates->set_var('lang_sortorder', $LANG27[14]);
        $topic_templates->set_var('sort_order', $LANG27[15]);
    }
    $topic_templates->set_var('lang_storiesperpage', $LANG27[11]);
    if ($A['limitnews'] == 0) {
        $topic_templates->set_var('story_limit', '');
    } else {
        $topic_templates->set_var('story_limit', $A['limitnews']);
    }
    $topic_templates->set_var('default_limit', $_CONF['limitnews']);
    $topic_templates->set_var('lang_defaultis', $LANG27[16]);
//.........这里部分代码省略.........
开发者ID:hostellerie,项目名称:nexpro,代码行数:101,代码来源:topic.php

示例6: editlink


//.........这里部分代码省略.........
    $link_templates = COM_newTemplate(CTL_plugin_templatePath('links', 'admin'));
    $link_templates->set_file('editor', 'linkeditor.thtml');
    $link_templates->set_var('lang_pagetitle', $LANG_LINKS_ADMIN[28]);
    $link_templates->set_var('lang_link_list', $LANG_LINKS_ADMIN[53]);
    $link_templates->set_var('lang_new_link', $LANG_LINKS_ADMIN[51]);
    $link_templates->set_var('lang_validate_links', $LANG_LINKS_ADMIN[26]);
    $link_templates->set_var('lang_list_categories', $LANG_LINKS_ADMIN[50]);
    $link_templates->set_var('lang_new_category', $LANG_LINKS_ADMIN[52]);
    $link_templates->set_var('lang_admin_home', $LANG_ADMIN['admin_home']);
    $link_templates->set_var('instructions', $LANG_LINKS_ADMIN[29]);
    if ($mode != 'editsubmission' and !empty($lid)) {
        $result = DB_query("SELECT * FROM {$_TABLES['links']} WHERE lid ='{$lid}'");
        if (DB_numRows($result) !== 1) {
            $msg = COM_showMessageText($LANG_LINKS_ADMIN[25], $LANG_LINKS_ADMIN[24]);
            return $msg;
        }
        $A = DB_fetchArray($result);
        $access = SEC_hasAccess($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']);
        if ($access == 0 or $access == 2) {
            $retval .= COM_showMessageText($LANG_LINKS_ADMIN[17], $LANG_LINKS_ADMIN[16]);
            COM_accessLog("User {$_USER['username']} tried to illegally submit or edit link {$lid}.");
            return $retval;
        }
    } else {
        if ($mode == 'editsubmission') {
            $result = DB_query("SELECT * FROM {$_TABLES['linksubmission']} WHERE lid = '{$lid}'");
            $A = DB_fetchArray($result);
        } else {
            $A['lid'] = COM_makesid();
            $A['cid'] = '';
            $A['url'] = '';
            $A['description'] = '';
            $A['title'] = '';
            $A['owner_id'] = $_USER['uid'];
        }
        $A['hits'] = 0;
        if (isset($_GROUPS['Links Admin'])) {
            $A['group_id'] = $_GROUPS['Links Admin'];
        } else {
            $A['group_id'] = SEC_getFeatureGroup('links.edit');
        }
        SEC_setDefaultPermissions($A, $_LI_CONF['default_permissions']);
        $access = 3;
    }
    $token = SEC_createToken();
    $retval .= COM_startBlock($LANG_LINKS_ADMIN[1], '', COM_getBlockTemplate('_admin_block', 'header'));
    $retval .= SEC_getTokenExpiryNotice($token);
    $link_templates->set_var('link_id', $A['lid']);
    if (!empty($lid) && SEC_hasRights('links.edit')) {
        $delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete'] . '" name="mode"%s' . XHTML . '>';
        $jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"';
        $link_templates->set_var('delete_option', sprintf($delbutton, $jsconfirm));
        $link_templates->set_var('delete_option_no_confirmation', sprintf($delbutton, ''));
        if ($mode == 'editsubmission') {
            $link_templates->set_var('submission_option', '<input type="hidden" name="type" value="submission"' . XHTML . '>');
        }
    }
    $link_templates->set_var('lang_linktitle', $LANG_LINKS_ADMIN[3]);
    $link_templates->set_var('link_title', htmlspecialchars(stripslashes($A['title'])));
    $link_templates->set_var('lang_linkid', $LANG_LINKS_ADMIN[2]);
    $link_templates->set_var('lang_linkurl', $LANG_LINKS_ADMIN[4]);
    $link_templates->set_var('max_url_length', 255);
    $link_templates->set_var('link_url', $A['url']);
    $link_templates->set_var('lang_includehttp', $LANG_LINKS_ADMIN[6]);
    $link_templates->set_var('lang_category', $LANG_LINKS_ADMIN[5]);
    $othercategory = links_select_box(3, $A['cid']);
    $link_templates->set_var('category_options', $othercategory);
    $link_templates->set_var('lang_ifotherspecify', $LANG_LINKS_ADMIN[20]);
    $link_templates->set_var('category', $othercategory);
    $link_templates->set_var('lang_linkhits', $LANG_LINKS_ADMIN[8]);
    $link_templates->set_var('link_hits', $A['hits']);
    $link_templates->set_var('lang_linkdescription', $LANG_LINKS_ADMIN[9]);
    $link_templates->set_var('link_description', stripslashes($A['description']));
    $allowed = COM_allowedHTML('links.edit') . COM_allowedAutotags();
    $link_templates->set_var('lang_allowed_html', $allowed);
    $link_templates->set_var('lang_save', $LANG_ADMIN['save']);
    $link_templates->set_var('lang_cancel', $LANG_ADMIN['cancel']);
    // user access info
    $link_templates->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
    $link_templates->set_var('lang_owner', $LANG_ACCESS['owner']);
    $ownername = COM_getDisplayName($A['owner_id']);
    $link_templates->set_var('owner_username', DB_getItem($_TABLES['users'], 'username', "uid = {$A['owner_id']}"));
    $link_templates->set_var('owner_name', $ownername);
    $link_templates->set_var('owner', $ownername);
    $link_templates->set_var('link_ownerid', $A['owner_id']);
    $link_templates->set_var('lang_group', $LANG_ACCESS['group']);
    $link_templates->set_var('group_dropdown', SEC_getGroupDropdown($A['group_id'], $access));
    $link_templates->set_var('lang_permissions', $LANG_ACCESS['permissions']);
    $link_templates->set_var('lang_permissionskey', $LANG_ACCESS['permissionskey']);
    $link_templates->set_var('lang_perm_key', $LANG_ACCESS['permissionskey']);
    $link_templates->set_var('permissions_editor', SEC_getPermissionsHTML($A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']));
    $link_templates->set_var('lang_permissions_msg', $LANG_ACCESS['permmsg']);
    $link_templates->set_var('lang_lockmsg', $LANG_ACCESS['permmsg']);
    $link_templates->set_var('gltoken_name', CSRF_TOKEN);
    $link_templates->set_var('gltoken', $token);
    $link_templates->parse('output', 'editor');
    $retval .= $link_templates->finish($link_templates->get_var('output'));
    $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));
    return $retval;
}
开发者ID:milk54,项目名称:geeklog-japan,代码行数:101,代码来源:index.php

示例7: editblock


//.........这里部分代码省略.........
        $block_templates->set_var('lang_delete', $LANG_ADMIN['delete']);
        $block_templates->set_var('confirm_message', $MESSAGE[76]);
    }
    $block_templates->set_var('block_bid', $A['bid']);
    // standard Admin strings
    $block_templates->set_var('lang_blocktitle', $LANG_ADMIN['title']);
    $block_templates->set_var('lang_enabled', $LANG_ADMIN['enabled']);
    $block_templates->set_var('lang_blockhelpurl', $LANG_ADMIN['help_url']);
    $block_templates->set_var('lang_topic', $LANG_ADMIN['topic']);
    $block_templates->set_var('lang_save', $LANG_ADMIN['save']);
    $block_templates->set_var('lang_cancel', $LANG_ADMIN['cancel']);
    $block_templates->set_var('lang_blocktype', $LANG_ADMIN['type']);
    $block_templates->set_var('lang_allowed_html', $LANG01[123]);
    $block_templates->set_var('block_title', stripslashes($A['title']));
    $block_templates->set_var('lang_enabled', $LANG21[53]);
    if ($A['is_enabled'] == 1) {
        $block_templates->set_var('is_enabled', 'checked="checked"');
    } else {
        $block_templates->set_var('is_enabled', '');
    }
    $block_templates->set_var('block_help', $A['help']);
    $block_templates->set_var('lang_includehttp', $LANG21[51]);
    $block_templates->set_var('lang_explanation', $LANG21[52]);
    $block_templates->set_var('block_name', $A['name']);
    $block_templates->set_var('lang_blockname', $LANG21[48]);
    $block_templates->set_var('lang_nospaces', $LANG21[49]);
    $block_templates->set_var('topic_selection', TOPIC_getTopicSelectionControl('block', $A['bid'], true, true));
    $block_templates->set_var('lang_side', $LANG21[39]);
    $block_templates->set_var('lang_left', $LANG21[40]);
    $block_templates->set_var('lang_right', $LANG21[41]);
    if ($A['onleft'] == 1) {
        $block_templates->set_var('left_selected', 'selected="selected"');
    } elseif ($A['onleft'] == 0) {
        $block_templates->set_var('right_selected', 'selected="selected"');
    }
    $block_templates->set_var('lang_blockorder', $LANG21[9]);
    $block_templates->set_var('block_order', $A['blockorder']);
    $block_templates->set_var('lang_normalblock', $LANG21[12]);
    $block_templates->set_var('lang_phpblock', $LANG21[27]);
    $block_templates->set_var('lang_portalblock', $LANG21[11]);
    if ($A['type'] == 'normal') {
        $block_templates->set_var('normal_selected', 'selected="selected"');
    } elseif ($A['type'] == 'phpblock') {
        $block_templates->set_var('php_selected', 'selected="selected"');
    } elseif ($A['type'] == 'portal') {
        $block_templates->set_var('portal_selected', 'selected="selected"');
    }
    $block_templates->set_var('lang_cachetime', $LANG21['cache_time']);
    $block_templates->set_var('lang_cachetime_desc', $LANG21['cache_time_desc']);
    $block_templates->set_var('cache_time', $A['cache_time']);
    $block_templates->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
    $block_templates->set_var('lang_owner', $LANG_ACCESS['owner']);
    $ownername = COM_getDisplayName($A['owner_id']);
    $block_templates->set_var('owner_username', DB_getItem($_TABLES['users'], 'username', "uid = '{$A['owner_id']}'"));
    $block_templates->set_var('owner_name', $ownername);
    $block_templates->set_var('owner', $ownername);
    $block_templates->set_var('owner_id', $A['owner_id']);
    $block_templates->set_var('lang_group', $LANG_ACCESS['group']);
    $block_templates->set_var('group_dropdown', SEC_getGroupDropdown($A['group_id'], $access));
    $block_templates->set_var('lang_permissions', $LANG_ACCESS['permissions']);
    $block_templates->set_var('lang_perm_key', $LANG_ACCESS['permissionskey']);
    $block_templates->set_var('permissions_editor', SEC_getPermissionsHTML($A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']));
    $block_templates->set_var('lang_permissions_msg', $LANG_ACCESS['permmsg']);
    $block_templates->set_var('lang_phpblockoptions', $LANG21[28]);
    $block_templates->set_var('lang_blockfunction', $LANG21[29]);
    $block_templates->set_var('block_phpblockfn', $A['phpblockfn']);
    $block_templates->set_var('lang_phpblockwarning', $LANG21[30]);
    $block_templates->set_var('lang_portalblockoptions', $LANG21[13]);
    $block_templates->set_var('lang_rdfurl', $LANG21[14]);
    $block_templates->set_var('max_url_length', 255);
    $block_templates->set_var('block_rdfurl', $A['rdfurl']);
    $block_templates->set_var('lang_rdflimit', $LANG21[62]);
    $block_templates->set_var('block_rdflimit', $A['rdflimit']);
    $block_templates->set_var('lang_lastrdfupdate', $LANG21[15]);
    if ($A['rdfupdated'] == '0000-00-00 00:00:00') {
        $block_templates->set_var('block_rdfupdated', '');
    } else {
        $block_templates->set_var('block_rdfupdated', $A['rdfupdated']);
    }
    $block_templates->set_var('lang_normalblockoptions', $LANG21[16]);
    $block_templates->set_var('lang_blockcontent', $LANG21[17]);
    $block_templates->set_var('lang_autotags', $LANG21[66]);
    $block_templates->set_var('lang_use_autotags', $LANG21[67]);
    $content = htmlspecialchars(stripslashes($A['content']));
    $content = str_replace(array('{', '}'), array('&#123;', '&#125;'), $content);
    $block_templates->set_var('block_content', $content);
    if ($A['allow_autotags'] == 1) {
        $block_templates->set_var('allow_autotags', 'checked="checked"');
    } else {
        $block_templates->set_var('allow_autotags', '');
    }
    $block_templates->set_var('gltoken_name', CSRF_TOKEN);
    $block_templates->set_var('gltoken', $token);
    $block_templates->set_var('end_block', COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer')));
    $block_templates->parse('output', 'editor');
    $retval .= $block_templates->finish($block_templates->get_var('output'));
    // Shows/Hides relevant block options dynamically
    $_SCRIPTS->setJavaScript("\njQuery(function () {\n    var \$ = jQuery;\n    \$('#admin-blockeditor-type').on('change', function () {\n        var fs, i, fieldsets = ['normal', 'phpblock', 'portal'];\n\n        for (i = 0; i < 3; i++) {\n            if (this.value === fieldsets[i]) {\n                \$('#fs-' + fieldsets[i] + '-options').show();\n            } else {\n                \$('#fs-' + fieldsets[i] + '-options').hide();\n            }\n        }\n    })\n    .trigger('change');\n});", true, true);
    return $retval;
}
开发者ID:ivywe,项目名称:geeklog,代码行数:101,代码来源:block.php

示例8: showForm

 /**
  *  Creates the edit form.
  *
  *  @param  integer $id Optional ID, current record used if zero
  *  @return string      HTML for edit form
  */
 public function showForm()
 {
     global $_TABLES, $_CONF, $_PP_CONF, $LANG_PP, $_SYSTEM;
     $T = new Template(PAYPAL_PI_PATH . '/templates');
     if ($_SYSTEM['framework'] == 'uikit') {
         $T->set_file('category', 'category_form.uikit.thtml');
     } else {
         $T->set_file('category', 'category_form.thtml');
     }
     $id = $this->cat_id;
     // If we have a nonzero category ID, then we edit the existing record.
     // Otherwise, we're creating a new item.  Also set the $not and $items
     // values to be used in the parent category selection accordingly.
     if ($id > 0) {
         $retval = COM_startBlock($LANG_PP['edit'] . ': ' . $this->cat_name);
         $T->set_var('cat_id', $id);
         $not = 'NOT';
         $items = $id;
     } else {
         $retval = COM_startBlock($LANG_PP['create_category']);
         $T->set_var('cat_id', '');
         $not = '';
         $items = '';
     }
     $T->set_var(array('action_url' => PAYPAL_ADMIN_URL, 'pi_url' => PAYPAL_URL, 'cat_name' => $this->cat_name, 'description' => $this->description, 'ena_chk' => $this->enabled == 1 ? 'checked="checked"' : '', 'parent_sel' => PAYPAL_recurseCats('PAYPAL_callbackCatOptionList', $this->parent_id, 0, '', $not, $items), 'group_sel' => SEC_getGroupDropdown($this->grp_access, 3, 'grp_access'), 'doc_url' => PAYPAL_getDocURL('category_form')));
     if ($this->image != '') {
         $T->set_var('img_url', PAYPAL_PI_URL . '/images/categories/' . $this->image);
     }
     if (!$this->isUsed()) {
         $T->set_var('can_delete', 'true');
     }
     /*
             // Might want this later to set default buttons per category
             $T->set_block('product', 'BtnRow', 'BRow');
             foreach ($LANG_PP['buttons'] as $key=>$value) {
                 $T->set_var(array(
                     'btn_type'  => $key,
                     'btn_chk'   => isset($this->buttons[$key]) ? 
                                     'checked="checked"' : '',
                     'btn_name'  => $value,
                 ));
                 $T->parse('BRow', 'BtnRow', true);
             }*/
     // If there's an image for this category, display it and offer
     // a link to delete it
     if ($this->image != '') {
         $T->set_var('img_url', PAYPAL_URL . '/images/categories/' . $this->image);
         $T->set_var('del_img_url', PAYPAL_ADMIN_URL . '/index.php?action=delete_img&amp;img_id=' . $prow['img_id'] . '&amp;id=' . $this->id);
     }
     $retval .= $T->parse('output', 'category');
     @setcookie($_CONF['cookie_name'] . 'fckeditor', SEC_createTokenGeneral('advancededitor'), time() + 1200, $_CONF['cookie_path'], $_CONF['cookiedomain'], $_CONF['cookiesecure']);
     $retval .= COM_endBlock();
     return $retval;
 }
开发者ID:JohnToro,项目名称:paypal,代码行数:60,代码来源:category.class.php

示例9: CLASSIFIEDS_adminMenu

                $content .= CLASSIFIEDS_adminMenu($actionval);
                $content .= CLASSIFIEDS_adminAdTypes();
                $admin_mode = ': ' . $LANG_ADVT['mnu_types'];
                break;
            case 'ad':
            default:
                $actionval = 'ad';
                $content .= CLASSIFIEDS_adminMenu($actionval);
                $content .= CLASSIFIEDS_adminAds();
                $admin_mode = ': ' . $LANG_ADVT['manage_ads'];
                break;
            case 'other':
                $content .= CLASSIFIEDS_adminMenu($actionval);
                $T1 = new Template(CLASSIFIEDS_PI_PATH . '/templates/admin/');
                $T1->set_file('content', 'adminother.thtml');
                $T1->set_var(array('cat_list' => SEC_getGroupDropdown($_CONF_ADVT['defgrpcat'], 3), 'cat_perms' => SEC_getPermissionsHTML($_CONF_ADVT['default_perm_cat'][0], $_CONF_ADVT['default_perm_cat'][1], $_CONF_ADVT['default_perm_cat'][2], $_CONF_ADVT['default_perm_cat'][3]), 'ad_list' => SEC_getGroupDropdown($_CONF_ADVT['defgrpad'], 3), 'ad_perms' => SEC_getPermissionsHTML($_CONF_ADVT['default_permissions'][0], $_CONF_ADVT['default_permissions'][1], $_CONF_ADVT['default_permissions'][2], $_CONF_ADVT['default_permissions'][3])));
                $T1->parse('output1', 'content');
                $content .= $T1->finish($T1->get_var('output1'));
                break;
        }
        break;
    default:
        USES_classifieds_admin();
        $content .= CLASSIFIEDS_adminMenu('ad');
        $content .= CLASSIFIEDS_adminAds();
        break;
}
// Generate the common header for all admin pages
echo CLASSIFIEDS_siteHeader();
$T = new Template(CLASSIFIEDS_PI_PATH . '/templates/admin/');
$T->set_file('admin', 'index.thtml');
开发者ID:NewRoute,项目名称:classifieds,代码行数:31,代码来源:index.php

示例10: STORY_edit


//.........这里部分代码省略.........
        $delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete'] . '" name="deletestory"%s/>';
        $jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"';
        $story_templates->set_var('delete_option', sprintf($delbutton, $jsconfirm));
        $story_templates->set_var('delete_option_no_confirmation', sprintf($delbutton, ''));
        $story_templates->set_var('lang_delete_confirm', $MESSAGE[76]);
    }
    if ($submission || $story->type == 'submission') {
        $story_templates->set_var('submission_option', '<input type="hidden" name="type" value="submission"/>');
    }
    $story_templates->set_var('admin_menu', ADMIN_createMenu($menu_arr, $LANG24[92], $_CONF['layout_url'] . '/images/icons/story.' . $_IMAGE_TYPE));
    $story_templates->set_var('lang_author', $LANG24[7]);
    $storyauthor = COM_getDisplayName($story->EditElements('uid'));
    $storyauthor_select = COM_optionList($_TABLES['users'], 'uid,username', $story->EditElements('uid'));
    $story_templates->set_var('story_author', $storyauthor);
    $story_templates->set_var('story_author_select', $storyauthor_select);
    $story_templates->set_var('author', $storyauthor);
    $story_templates->set_var('story_uid', $story->EditElements('uid'));
    // user access info
    $story_templates->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
    $story_templates->set_var('lang_owner', $LANG_ACCESS['owner']);
    $ownername = COM_getDisplayName($story->EditElements('owner_id'));
    $story_templates->set_var('owner_username', DB_getItem($_TABLES['users'], 'username', 'uid = ' . (int) $story->EditElements('owner_id')));
    $story_templates->set_var('owner_name', $ownername);
    $story_templates->set_var('owner', $ownername);
    $story_templates->set_var('owner_id', $story->EditElements('owner_id'));
    if (SEC_hasRights('story.edit')) {
        $story_templates->set_var('owner_dropdown', COM_buildOwnerList('owner_id', $story->EditElements('owner_id')));
    } else {
        $ownerInfo = '<input type="hidden" name="owner_id" value="' . $story->editElements('owner_id') . '" />' . $ownername;
        $story_templates->set_var('owner_dropdown', $ownerInfo);
    }
    $story_templates->set_var('lang_group', $LANG_ACCESS['group']);
    if (SEC_inGroup($story->EditElements('group_id'))) {
        $story_templates->set_var('group_dropdown', SEC_getGroupDropdown($story->EditElements('group_id'), 3));
    } else {
        $gdrpdown = '<input type="hidden" name="group_id" value="' . $story->EditElements('group_id') . '"/>';
        $grpddown .= DB_getItem($_TABLES['groups'], 'grp_name', 'grp_id=' . (int) $story->EditElements('group_id'));
        $story_templates->set_var('group_dropdown', $grpddown);
    }
    $story_templates->set_var('lang_permissions', $LANG_ACCESS['permissions']);
    $story_templates->set_var('lang_perm_key', $LANG_ACCESS['permissionskey']);
    $story_templates->set_var('permissions_editor', SEC_getPermissionsHTML($story->EditElements('perm_owner'), $story->EditElements('perm_group'), $story->EditElements('perm_members'), $story->EditElements('perm_anon')));
    $story_templates->set_var('permissions_msg', $LANG_ACCESS['permmsg']);
    $curtime = COM_getUserDateTimeFormat($story->EditElements('date'));
    $story_templates->set_var('lang_date', $LANG24[15]);
    $story_templates->set_var('publish_second', $story->EditElements('publish_second'));
    $publish_ampm = '';
    $publish_hour = $story->EditElements('publish_hour');
    if ($publish_hour >= 12) {
        if ($publish_hour > 12) {
            $publish_hour = $publish_hour - 12;
        }
        $ampm = 'pm';
    } else {
        $ampm = 'am';
    }
    $ampm_select = COM_getAmPmFormSelection('publish_ampm', $ampm);
    $story_templates->set_var('publishampm_selection', $ampm_select);
    $month_options = COM_getMonthFormOptions($story->EditElements('publish_month'));
    $story_templates->set_var('publish_month_options', $month_options);
    $day_options = COM_getDayFormOptions($story->EditElements('publish_day'));
    $story_templates->set_var('publish_day_options', $day_options);
    $year_options = COM_getYearFormOptions($story->EditElements('publish_year'));
    $story_templates->set_var('publish_year_options', $year_options);
    if ($_CONF['hour_mode'] == 24) {
        $hour_options = COM_getHourFormOptions($story->EditElements('publish_hour'), 24);
开发者ID:spacequad,项目名称:glfusion,代码行数:67,代码来源:story.php

示例11: CMED_editMenuitem

function CMED_editMenuitem($mid, $mode = 'edit', $A = array())
{
    global $_CONF, $_GROUPS, $_TABLES, $_USER, $_PLUGINS, $_CMED_CONF, $LANG_CMED_EDITOR, $LANG_ACCESS, $LANG_ADMIN, $MESSAGE;
    $retval = '';
    if ($mode == 'edit' || $mode == 'clone') {
        if (empty($A)) {
            $result = DB_query("SELECT * FROM {$_TABLES['menuitems']} WHERE mid ='{$mid}'");
            $A = DB_fetchArray($result);
        }
        $access = SEC_hasAccess($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']);
        if ($access < 3 || CMED_hasMenuitemTopicAccess($A['tid']) < 3) {
            $retval .= COM_startBlock($LANG_ACCESS['accessdenied'], '', COM_getBlockTemplate('_msg_block', 'header')) . $LANG_CMED_EDITOR['message_access1'] . COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
            COM_accessLog("User {$_USER['username']} tried to illegally create or edit menuitem {$mid}.");
            return $retval;
        }
        $selpmid = CMED_makeSelBox($A['pmid']);
    }
    if ($mode == 'clone') {
        preg_match('/(.*)_clone_(.+)/', $A['mid'], $match);
        $label = empty($match[1]) ? $A['mid'] : $match[1];
        $A['mid'] = CMED_createMenuitemID($label . '_clone_');
        $A['type'] = 'custom';
        $access = 3;
    }
    if ($mode == 'create') {
        $A['mid'] = CMED_createMenuitemID();
        $A['pmid'] = '';
        $A['is_enabled'] = 1;
        $A['type'] = 'custom';
        $A['mode'] = 'fixation';
        $A['label'] = '';
        $A['label_var'] = '';
        $A['php_function'] = '';
        $A['tid'] = 'all';
        $A['url'] = '';
        $A['icon_url'] = '';
        $A['menuorder'] = 0;
        $A['pattern'] = '';
        $A['is_preg'] = 0;
        $A['class_name'] = '';
        $selpmid = CMED_makeSelBox();
        $A['owner_id'] = $_USER['uid'];
        if (isset($_GROUPS['CustomMenu Admin'])) {
            $A['group_id'] = $_GROUPS['CustomMenu Admin'];
        } else {
            $A['group_id'] = SEC_getFeatureGroup('custommenu.admin');
        }
        SEC_setDefaultPermissions($A, $_CMED_CONF['default_permissions']);
        $access = 3;
    }
    $T = COM_newTemplate($_CMED_CONF['path_layout']);
    $T->set_file('editor', 'menueditor.thtml');
    $T->set_var('icon_url', plugin_geticon_custommenu());
    $retval .= COM_startBlock($LANG_CMED_EDITOR['custommenueditor'], '', COM_getBlockTemplate('_admin_block', 'header'));
    $v = $mode == 'create' || $mode == 'clone' || $A['type'] == 'gldefault' || $A['type'] == 'plugin' && in_array($A['mid'], $_PLUGINS) ? UC_DISABLED : '';
    $T->set_var('delete_disabled', $v);
    foreach ($LANG_CMED_EDITOR as $key => $val) {
        $T->set_var('lang_' . $key, $val);
    }
    $v = ($mode == 'create' or $mode == 'clone') ? 'save' : 'update';
    $T->set_var('lang_save', $LANG_CMED_EDITOR[$v]);
    $T->set_var('val_title_fixation', stripslashes($A['label']));
    $T->set_var('val_title_variable', stripslashes($A['label_var']));
    $T->set_var('val_php_function', stripslashes($A['php_function']));
    $T->set_var('val_is_enabled', $A['is_enabled'] == 1 ? UC_CHECKED : '');
    $T->set_var('val_menuitemurl', $A['url']);
    $T->set_var('val_icon_url', $A['icon_url']);
    $T->set_var('val_mid', $A['mid']);
    $T->set_var('val_pmid', $A['pmid']);
    $T->set_var('selpmid', $selpmid);
    $T->set_var('val_old_mid', $A['mid']);
    $T->set_var('val_menuorder', $A['menuorder']);
    $T->set_var('val_type', $A['type']);
    $T->set_var('val_pattern', stripslashes($A['pattern']));
    $T->set_var('val_is_preg', $A['is_preg'] == 1 ? UC_CHECKED : '');
    $T->set_var('val_class_name', stripslashes($A['class_name']));
    $v = $A['type'] == 'gldefault' || $A['type'] == 'plugin' ? UC_READONLY : '';
    $T->set_var('mid_readonly', $v);
    $T->set_var($A['tid'] . '_selected', UC_SELECTED);
    $T->set_var('topic_options', COM_topicList('tid,topic', $A['tid'], 1, true));
    $T->set_var('lang_type', $LANG_CMED_EDITOR['type_' . $A['type']]);
    $T->set_var($A['type'] . '_selected', UC_SELECTED);
    $T->set_var('val_mode_' . $A['mode'], UC_SELECTED);
    // user access info
    $T->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
    $T->set_var('lang_owner', $LANG_ACCESS['owner']);
    $ownername = COM_getDisplayName($A['owner_id']);
    $T->set_var('owner_username', DB_getItem($_TABLES['users'], 'username', "uid = {$A['owner_id']}"));
    $T->set_var('owner_name', $ownername);
    $T->set_var('owner', $ownername);
    $T->set_var('owner_id', $A['owner_id']);
    $T->set_var('lang_group', $LANG_ACCESS['group']);
    $T->set_var('group_dropdown', SEC_getGroupDropdown($A['group_id'], $access));
    $T->set_var('lang_permissions', $LANG_ACCESS['permissions']);
    $T->set_var('lang_permissionskey', $LANG_ACCESS['permissionskey']);
    $T->set_var('permissions_editor', SEC_getPermissionsHTML($A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']));
    $T->set_var('lang_lockmsg', $LANG_ACCESS['permmsg']);
    if (!defined(CSRF_TOKEN)) {
        define('CSRF_TOKEN', 'token');
    }
//.........这里部分代码省略.........
开发者ID:milk54,项目名称:geeklog-japan,代码行数:101,代码来源:index.php

示例12: PAYPAL_getProductForm


//.........这里部分代码省略.........
    $template->set_var('per_item', $LANG_PAYPAL_ADMIN['per_item']);
    //shipping
    $template->set_var('shipping_type', $LANG_PAYPAL_ADMIN['shipping_type']);
    $template->set_var('shipping_type_ini', $product['shipping_type']);
    $shipping_options = '';
    if ($product['shipping_type'] == 0) {
        $selected0 = ' selected="selected"';
        $selected1 = '';
    } else {
        $selected1 = ' selected="selected"';
        $selected0 = '';
    }
    $shipping_options .= '<option value="0"' . $selected0 . '>' . $LANG_PAYPAL_ADMIN['shipping_options'][0] . '</option>';
    $shipping_options .= '<option value="1"' . $selected1 . '>' . $LANG_PAYPAL_ADMIN['shipping_options'][1] . '</option>';
    $template->set_var('shipping_options', $shipping_options);
    $template->set_var('yes', $LANG_PAYPAL_1['yes']);
    $template->set_var('no', $LANG_PAYPAL_1['no']);
    $template->set_var('save_button', $LANG_PAYPAL_1['save_button']);
    $template->set_var('delete_button', $LANG_PAYPAL_1['delete_button']);
    $template->set_var('ok_button', $LANG_PAYPAL_1['ok_button']);
    $template->set_var('required_field', $LANG_PAYPAL_1['required_field']);
    if ($product['product_type'] == 1) {
        $template->set_var('download_yes', ' selected');
        $template->set_var('download_no', '');
    } else {
        $template->set_var('download_yes', '');
        $template->set_var('download_no', ' selected');
    }
    $template->set_var('file', $product['file']);
    $template->set_var('expiration', $product['expiration']);
    //Subscription
    $type != 'subscription' ? $template->set_var('display_subscription', 'display:none;') : $template->set_var('display_subscription', '');
    $template->set_var('subscription_product_label', $LANG_PAYPAL_1['subscription_label']);
    $template->set_var('duration_label', $LANG_PAYPAL_1['duration_label']);
    $template->set_var('duration', $product['duration']);
    $product['duration_type'] == 'day' ? $template->set_var('sel_day', ' selected="selected"') : '';
    $template->set_var('day', $LANG_PAYPAL_1['day']);
    $product['duration_type'] == 'week' ? $template->set_var('sel_week', ' selected="selected"') : '';
    $template->set_var('week', $LANG_PAYPAL_1['week']);
    $product['duration_type'] == 'month' ? $template->set_var('sel_month', ' selected="selected"') : '';
    $template->set_var('month', $LANG_PAYPAL_1['month']);
    $product['duration_type'] == 'year' ? $template->set_var('sel_year', ' selected="selected"') : '';
    $template->set_var('year', $LANG_PAYPAL_1['year']);
    //Recurrent
    if ($type != 'recurrent') {
        $template->set_var('display_recurrent', 'display:none;');
        $template->set_var('add_to_group_label', $LANG_PAYPAL_1['recurrent_add_to_group']);
    } else {
        $template->set_var('display_recurrent', '');
    }
    $template->set_var('recurrent_product_label', $LANG_PAYPAL_1['recurrent_product_label']);
    $template->set_var('add_to_group_label', $LANG_PAYPAL_1['recurrent_add_to_group']);
    $template->set_var('period_label', $LANG_PAYPAL_1['period_label']);
    $template->set_var('billing_label', $LANG_PAYPAL_1['billing_label']);
    $template->set_var('billingamt', $product['billingamt']);
    $template->set_var('frequency_label', $LANG_PAYPAL_1['frequency_label']);
    $template->set_var('frequency_help', $LANG_PAYPAL_1['frequency_help']);
    $template->set_var('duration_recurrent', $product['duration']);
    $product['duration_type'] == 'Day' ? $template->set_var('sel_recurrent_day', ' selected="selected"') : '';
    $template->set_var('recurrent_day', $LANG_PAYPAL_1['recurrent_day']);
    $product['duration_type'] == 'Week' ? $template->set_var('sel_recurrent_week', ' selected="selected"') : '';
    $template->set_var('recurrent_week', $LANG_PAYPAL_1['recurrent_week']);
    $product['duration_type'] == 'SemiMonth' ? $template->set_var('sel_recurrent_semimonth', ' selected="selected"') : '';
    $template->set_var('recurrent_semimonth', $LANG_PAYPAL_1['recurrent_semimonth']);
    $product['duration_type'] == 'Month' ? $template->set_var('sel_recurrent_month', ' selected="selected"') : '';
    $template->set_var('recurrent_month', $LANG_PAYPAL_1['recurrent_month']);
    $product['duration_type'] == 'Year' ? $template->set_var('sel_recurrent_year', ' selected="selected"') : '';
    $template->set_var('recurrent_year', $LANG_PAYPAL_1['recurrent_year']);
    //Group select list
    $template->set_var('add_to_group_options', COM_optionList($_TABLES['groups'], 'grp_id,grp_name', $product['add_to_group'], 1));
    // Permissions
    if ($product['perm_owner'] == '') {
        SEC_setDefaultPermissions($product, $_PAY_CONF['default_permissions']);
    }
    $template->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
    $template->set_var('lang_owner', $LANG_ACCESS['owner']);
    if ($product['owner_id'] == '') {
        $product['owner_id'] = $_USER['uid'];
    }
    $ownername = COM_getDisplayName($product['owner_id']);
    $template->set_var('owner_username', DB_getItem($_TABLES['users'], 'username', "uid = {$product['owner_id']}"));
    $template->set_var('owner_name', $ownername);
    $template->set_var('owner', $ownername);
    $template->set_var('owner_id', $product['owner_id']);
    if ($product['group_id'] == '') {
        $product['group_id'] = $_GROUPS['Paypal Admin'];
    }
    $template->set_var('lang_group', $LANG_ACCESS['group']);
    //Todo make group = paypal.admin
    $access = 3;
    $template->set_var('group_dropdown', SEC_getGroupDropdown($product['group_id'], $access));
    $template->set_var('permissions_editor', SEC_getPermissionsHTML($product['perm_owner'], $product['perm_group'], $product['perm_members'], $product['perm_anon']));
    $template->set_var('lang_permissions', $LANG_ACCESS['permissions']);
    $template->set_var('lang_perm_key', $LANG_ACCESS['permissionskey']);
    $template->set_var('permissions_msg', $LANG_ACCESS['permmsg']);
    $template->set_var('lang_permissions_msg', $LANG_ACCESS['permmsg']);
    $display .= $template->parse('output', 'product');
    $display .= COM_endBlock();
    return $display;
}
开发者ID:Geeklog-Plugins,项目名称:paypal,代码行数:101,代码来源:product_edit.php

示例13: editblock


//.........这里部分代码省略.........
    $block_templates->set_var('lang_topic', $LANG_ADMIN['topic']);
    $block_templates->set_var('lang_save', $LANG_ADMIN['save']);
    $block_templates->set_var('lang_cancel', $LANG_ADMIN['cancel']);
    $block_templates->set_var('lang_blocktype', $LANG_ADMIN['type']);
    $block_templates->set_var('lang_allowed_html', $LANG01[123]);
    $block_templates->set_var('block_title', stripslashes($A['title']));
    $block_templates->set_var('lang_enabled', $LANG21[53]);
    if ($A['is_enabled'] == 1) {
        $block_templates->set_var('is_enabled', 'checked="checked"');
    } else {
        $block_templates->set_var('is_enabled', '');
    }
    $block_templates->set_var('block_help', $A['help']);
    $block_templates->set_var('lang_includehttp', $LANG21[51]);
    $block_templates->set_var('lang_explanation', $LANG21[52]);
    $block_templates->set_var('block_name', $A['name']);
    $block_templates->set_var('lang_blockname', $LANG21[48]);
    $block_templates->set_var('lang_nospaces', $LANG21[49]);
    $block_templates->set_var('lang_all', $LANG21[7]);
    $block_templates->set_var('lang_homeonly', $LANG21[43]);
    if ($A['tid'] == 'all') {
        $block_templates->set_var('all_selected', 'selected="selected"');
    } else {
        if ($A['tid'] == 'homeonly') {
            $block_templates->set_var('homeonly_selected', 'selected="selected"');
        }
    }
    $block_templates->set_var('topic_options', COM_topicList('tid,topic', $A['tid'], 1, true));
    $block_templates->set_var('lang_side', $LANG21[39]);
    $block_templates->set_var('lang_left', $LANG21[40]);
    $block_templates->set_var('lang_right', $LANG21[41]);
    if ($A['onleft'] == 1) {
        $block_templates->set_var('left_selected', 'selected="selected"');
    } else {
        if ($A['onleft'] == 0) {
            $block_templates->set_var('right_selected', 'selected="selected"');
        }
    }
    $block_templates->set_var('lang_blockorder', $LANG21[9]);
    $block_templates->set_var('block_order', $A['blockorder']);
    $block_templates->set_var('lang_normalblock', $LANG21[12]);
    $block_templates->set_var('lang_phpblock', $LANG21[27]);
    $block_templates->set_var('lang_portalblock', $LANG21[11]);
    if ($A['type'] == 'normal') {
        $block_templates->set_var('normal_selected', 'selected="selected"');
    } else {
        if ($A['type'] == 'phpblock') {
            $block_templates->set_var('php_selected', 'selected="selected"');
        } else {
            if ($A['type'] == 'portal') {
                $block_templates->set_var('portal_selected', 'selected="selected"');
            }
        }
    }
    $block_templates->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);
    $block_templates->set_var('lang_owner', $LANG_ACCESS['owner']);
    $ownername = COM_getDisplayName($A['owner_id']);
    $block_templates->set_var('owner_username', DB_getItem($_TABLES['users'], 'username', "uid = '{$A['owner_id']}'"));
    $block_templates->set_var('owner_name', $ownername);
    $block_templates->set_var('owner', $ownername);
    $block_templates->set_var('owner_id', $A['owner_id']);
    $block_templates->set_var('lang_group', $LANG_ACCESS['group']);
    $block_templates->set_var('group_dropdown', SEC_getGroupDropdown($A['group_id'], $access));
    $block_templates->set_var('lang_permissions', $LANG_ACCESS['permissions']);
    $block_templates->set_var('lang_perm_key', $LANG_ACCESS['permissionskey']);
    $block_templates->set_var('permissions_editor', SEC_getPermissionsHTML($A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']));
    $block_templates->set_var('lang_permissions_msg', $LANG_ACCESS['permmsg']);
    $block_templates->set_var('lang_phpblockoptions', $LANG21[28]);
    $block_templates->set_var('lang_blockfunction', $LANG21[29]);
    $block_templates->set_var('block_phpblockfn', $A['phpblockfn']);
    $block_templates->set_var('lang_phpblockwarning', $LANG21[30]);
    $block_templates->set_var('lang_portalblockoptions', $LANG21[13]);
    $block_templates->set_var('lang_rdfurl', $LANG21[14]);
    $block_templates->set_var('max_url_length', 255);
    $block_templates->set_var('block_rdfurl', $A['rdfurl']);
    $block_templates->set_var('lang_rdflimit', $LANG21[62]);
    $block_templates->set_var('block_rdflimit', $A['rdflimit']);
    $block_templates->set_var('lang_lastrdfupdate', $LANG21[15]);
    if ($A['rdfupdated'] == '0000-00-00 00:00:00') {
        $block_templates->set_var('block_rdfupdated', '');
    } else {
        $block_templates->set_var('block_rdfupdated', $A['rdfupdated']);
    }
    $block_templates->set_var('lang_normalblockoptions', $LANG21[16]);
    $block_templates->set_var('lang_blockcontent', $LANG21[17]);
    $block_templates->set_var('lang_autotags', $LANG21[66]);
    $block_templates->set_var('lang_use_autotags', $LANG21[67]);
    $block_templates->set_var('block_content', htmlspecialchars(stripslashes($A['content'])));
    if ($A['allow_autotags'] == 1) {
        $block_templates->set_var('allow_autotags', 'checked="checked"');
    } else {
        $block_templates->set_var('allow_autotags', '');
    }
    $block_templates->set_var('gltoken_name', CSRF_TOKEN);
    $block_templates->set_var('gltoken', $token);
    $block_templates->set_var('end_block', COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer')));
    $block_templates->parse('output', 'editor');
    $retval .= $block_templates->finish($block_templates->get_var('output'));
    return $retval;
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:101,代码来源:block.php

示例14: Edit

 /**
  *   Provide the form to create or edit a calendar
  *
  *   @return string  HTML for editing form
  */
 public function Edit()
 {
     global $_SYSTEM;
     $T = new Template(EVLIST_PI_PATH . '/templates');
     $T->set_file('modify', 'calEditForm.thtml');
     $T->set_var(array('cal_id' => $this->cal_id, 'cal_name' => $this->cal_name, 'fgcolor' => $this->fgcolor, 'bgcolor' => $this->bgcolor, 'owner_id' => $this->owner_id, 'ownername' => COM_getDisplayName($this->owner_id), 'group_dropdown' => SEC_getGroupDropdown($this->group_id, 3), 'permissions_editor' => SEC_getPermissionsHTML($this->perm_owner, $this->perm_group, $this->perm_members, $this->perm_anon), 'stat_chk' => $this->cal_status == 1 ? EVCHECKED : '', 'ical_chk' => $this->cal_ena_ical == 1 ? EVCHECKED : '', 'cancel_url' => EVLIST_ADMIN_URL . '/index.php?admin=cal', 'can_delete' => $this->cal_id > 1 ? 'true' : '', 'mootools' => $_SYSTEM['disable_mootools'] ? '' : 'true'));
     $T->parse('output', 'modify');
     $display .= $T->finish($T->get_var('output'));
     return $display;
 }
开发者ID:matrox66,项目名称:evlist,代码行数:15,代码来源:evCalendar.class.php

示例15: Edit

 /**
  *   Create an edit form for a category
  *
  *   @param  int     $catid  Category ID, zero for a new entry
  *   @return string      HTML for edit form
  */
 public function Edit($cat_id = 0)
 {
     global $_CONF, $_TABLES, $LANG_ADVT, $_CONF_ADVT, $LANG_ACCESS, $_USER;
     $cat_id = (int) $cat_id;
     if ($cat_id > 0) {
         // Load the requested category
         $this->cat_id = $cat_id;
         $this->Read();
     }
     $T = new Template(CLASSIFIEDS_PI_PATH . '/templates/admin');
     $T->set_file('modify', 'catEditForm.thtml');
     // create a dropdown list of only master categories
     //$T->set_var('sel_parent_cat', COM_optionList($_TABLES['ad_category'],
     //    'cat_id,cat_name', $parentcat, 1, "cat_id <> $catid AND papa_id=0"));
     // this code creates a complete dropdown including subcategories
     $T->set_var('sel_parent_cat', self::buildSelection($this->papa_id, 0, '', 'NOT', $this->cat_id));
     if (!$this->isNew) {
         // If this is an existing category, load the template with the
         // categories values.
         $T->set_var(array('permissions_editor' => SEC_getPermissionsHTML($this->perm_owner, $this->perm_group, $this->perm_members, $this->perm_anon), 'ownername' => COM_getDisplayName($this->owner_id), 'owner_id' => $this->owner_id, 'group_dropdown' => SEC_getGroupDropdown($this->group_id, 3)));
     } else {
         // A new category gets default values
         $T->set_var(array('txt_sub_btn' => $LANG_ADVT['add_cat'], 'permissions_editor' => SEC_getPermissionsHTML($_CONF_ADVT['default_perm_cat'][0], $_CONF_ADVT['default_perm_cat'][1], $_CONF_ADVT['default_perm_cat'][2], $_CONF_ADVT['default_perm_cat'][3]), 'ownername' => COM_getDisplayName($_USER['uid']), 'owner_id' => $_USER['uid'], 'group_dropdown' => SEC_getGroupDropdown($_CONF_ADVT['defgrpcat'], 3)));
     }
     $T->set_var(array('location' => self::BreadCrumbs($this->cat_id, true), 'catname' => $this->cat_name, 'keywords' => $this->keywords, 'description' => $this->description, 'fgcolor' => $this->fgcolor, 'bgcolor' => $this->bgcolor, 'cat_id' => $this->cat_id, 'cancel_url' => CLASSIFIEDS_ADMIN_URL . '/index.php?admin=cat'));
     if ($this->image != '') {
         $T->set_var('existing_image', CLASSIFIEDS_thumbUrl($this->image));
     }
     $T->parse('output', 'modify');
     $display .= $T->finish($T->get_var('output'));
     return $display;
 }
开发者ID:NewRoute,项目名称:classifieds,代码行数:38,代码来源:category.class.php


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