本文整理汇总了PHP中CTL_plugin_templatePath函数的典型用法代码示例。如果您正苦于以下问题:PHP CTL_plugin_templatePath函数的具体用法?PHP CTL_plugin_templatePath怎么用?PHP CTL_plugin_templatePath使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CTL_plugin_templatePath函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showtopic
function showtopic($showtopic, $mode = '', $onetwo = 1, $page = 1)
{
global $CONF_FORUM, $_CONF, $_TABLES, $_USER, $LANG_GF01, $LANG_GF02, $LANG_GF09;
global $highlight;
global $oldPost;
$oldPost = 0;
//$mytimer = new timerobject();
//$mytimer->setPercision(2);
//$mytimer->startTimer();
//$intervalTime = $mytimer->stopTimer();
//COM_errorLog("Show Topic Display Time1: $intervalTime");
if (!class_exists('StringParser')) {
require_once $CONF_FORUM['path_include'] . 'bbcode/stringparser_bbcode.class.php';
}
$topictemplate = COM_newTemplate(CTL_plugin_templatePath('forum'));
$topictemplate->set_file(array('topictemplate' => 'topic.thtml', 'forum_icons' => 'forum_icons.thtml', 'forum_links' => 'forum_links.thtml'));
$topictemplate->set_block('topictemplate', 'block_user_information');
$topictemplate->set_block('topictemplate', 'block_anon_user_information');
$topictemplate->set_block('topictemplate', 'location');
$topictemplate->set_block('topictemplate', 'ip_address');
$topictemplate->set_block('topictemplate', 'anon_ip_address');
$topictemplate->set_block('topictemplate', 'user_signature');
$topictemplate->set_block('topictemplate', 'mod_functions');
$blocks = array('block_user_name', 'block_anon_user_name', 'block_user_information', 'block_anon_user_information', 'user_signature', 'mod_functions');
foreach ($blocks as $block) {
$topictemplate->set_block('topictemplate', $block);
}
$topictemplate->set_block('forum_icons', 'topiclocked_icon');
$topictemplate->set_block('forum_icons', 'mood_icon');
$blocks = array('profile_link', 'pm_link', 'email_link', 'website_link', 'quotetopic_link', 'edittopic_link');
foreach ($blocks as $block) {
$topictemplate->set_block('forum_links', $block);
}
// if preview, only stripslashes is gpc=on, else assume from db so strip
if ($mode == 'preview') {
$showtopic['subject'] = COM_stripslashes($showtopic['subject']);
} else {
$showtopic['subject'] = stripslashes($showtopic['subject']);
}
$min_height = 50;
// Base minimum height of topic - will increase if avatar or sig is used
$date = strftime($CONF_FORUM['default_Topic_Datetime_format'], $showtopic['date']);
$sql = "SELECT u.*, ui.location FROM {$_TABLES['users']} u, {$_TABLES['userinfo']} ui \n \t\tWHERE u.uid = ui.uid \n \t\tAND u.uid = '{$showtopic['uid']}'";
$userQuery = DB_query($sql);
if ($showtopic['uid'] > 1 and DB_numRows($userQuery) == 1) {
$userarray = DB_fetchArray($userQuery);
$username = COM_getDisplayName($showtopic['uid']);
$userlink = "<a href=\"{$_CONF['site_url']}/users.php?mode=profile&uid={$showtopic['uid']}\" ";
$userlink .= "class=\"authorname {$onetwo}\"><b>{$username}</b></a>";
$uservalid = true;
$postcount = DB_query("SELECT * FROM {$_TABLES['forum_topic']} WHERE uid='{$showtopic['uid']}'");
$posts = DB_numRows($postcount);
// STARS CODE
if (SEC_inGroup(1, $showtopic['uid'])) {
$user_level = showrank(7, $LANG_GF01['admin']);
$user_levelname = $LANG_GF01['admin'];
} else {
if (forum_modPermission($showtopic['forum'], $showtopic['uid'])) {
$user_level = showrank(6, $LANG_GF01['moderator']);
$user_levelname = $LANG_GF01['moderator'];
} else {
if ($posts < $CONF_FORUM['level2']) {
$user_level = showrank(1, $CONF_FORUM['level1name']);
$user_levelname = $CONF_FORUM['level1name'];
} elseif ($posts >= $CONF_FORUM['level2'] && $posts < $CONF_FORUM['level3']) {
$user_level = showrank(2, $CONF_FORUM['level2name']);
$user_levelname = $CONF_FORUM['level2name'];
} elseif ($posts >= $CONF_FORUM['level3'] && $posts < $CONF_FORUM['level4']) {
$user_level = showrank(3, $CONF_FORUM['level3name']);
$user_levelname = $CONF_FORUM['level3name'];
} elseif ($posts >= $CONF_FORUM['level4'] && $posts < $CONF_FORUM['level5']) {
$user_level = showrank(4, $CONF_FORUM['level4name']);
$user_levelname = $CONF_FORUM['level4name'];
} elseif ($posts > $CONF_FORUM['level5']) {
$user_level = showrank(5, $CONF_FORUM['level5name']);
$user_levelname = $CONF_FORUM['level5name'];
}
}
}
// Still allow photo to be showen for users
if ($showtopic['uid'] > 1 and ($userarray['photo'] != "" or !empty($_CONF['default_photo']))) {
$avatar = USER_getPhoto($showtopic['uid'], '', '', $CONF_FORUM['avatar_width']);
$min_height = $min_height + 50;
} else {
$avatar = '';
}
$regdate = $LANG_GF01['REGISTERED'] . ': ' . strftime($_CONF['shortdate'], strtotime($userarray['regdate'])) . '<br' . XHTML . '>';
$numposts = $LANG_GF01['POSTS'] . ': ' . $posts;
if (DB_count($_TABLES['sessions'], 'uid', $showtopic['uid']) > 0 and DB_getItem($_TABLES['userprefs'], 'showonline', "uid={$showtopic['uid']}") == 1) {
$avatar .= '<br' . XHTML . '>' . $LANG_GF01['STATUS'] . ' ' . $LANG_GF01['ONLINE'];
} else {
$avatar .= '<br' . XHTML . '>' . $LANG_GF01['STATUS'] . ' ' . $LANG_GF01['OFFLINE'];
}
if ($userarray['sig'] != '') {
$sig = $userarray['sig'];
$min_height = $min_height + 30;
} else {
$sig = '';
}
} else {
//.........这里部分代码省略.........
示例2: editlink
/**
* Shows the links editor
*
* @param string $mode Used to see if we are moderating a link or simply editing one
* @param string $lid ID of link to edit
* @global array core config vars
* @global array core group data
* @global array core table data
* @global array core user data
* @global array links plugin config vars
* @global array links plugin lang vars
* @global array core lang access vars
* @return string HTML for the link editor form
*
*/
function editlink($mode, $lid = '')
{
global $_CONF, $_GROUPS, $_TABLES, $_USER, $_LI_CONF, $LANG_LINKS_ADMIN, $LANG_ACCESS, $LANG_ADMIN, $MESSAGE;
$retval = '';
$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']);
//.........这里部分代码省略.........
示例3: gf_showVariables
// Debug Code to show variables
$display .= gf_showVariables();
// Check if the number of records was specified to show - part of page navigation.
if ($show == 0 and $CONF_FORUM['show_messages_perpage'] > 0) {
$show = $CONF_FORUM['show_messages_perpage'];
} elseif ($show == 0) {
$show = 20;
}
// Check if this is the first page.
if (empty($page)) {
$page = 1;
}
$display .= COM_startBlock($LANG_GF02['msg193']);
$navbar->set_selected($LANG_GF06['5']);
$display .= $navbar->generate();
$p = COM_newTemplate(CTL_plugin_templatePath('forum', 'admin'));
$p->set_file(array('page' => 'migrate.thtml'));
$p->set_block('page', 'report_record');
$p->set_block('page', 'message');
$p->set_block('page', 'no_records_message');
if (!empty($_GET['num_stories']) && !empty($_GET['num_posts'])) {
$p->set_var('status_message', sprintf($LANG_GF02['msg192'], $_GET['num_stories'], $_GET['num_posts']));
$p->parse('message', 'message');
} else {
$p->set_var('show_message', 'none');
}
if (!empty($curtopic) && $curtopic != 'all') {
if ($curtopic == "submissions") {
$table_name = $_TABLES['storysubmission'];
$sql_part0 = "SELECT ta.tid,s.sid,s.title,s.date,0 AS comments ";
$sql_part2 = '';
示例4: alertMessage
$forumlisting->parse('category_records', 'category_record', true);
$forumlisting->parse('forum_records', '');
}
}
if ($numCategories == 0) {
// Do we have any categories defined yet
$display .= alertMessage($LANG_GF01['MSG_NO_CAT'], $LANG_GF01['ERROR'], false);
}
$forumlisting->parse('output', 'forumlisting');
$display .= $forumlisting->finish($forumlisting->get_var('output'));
//$exectime = $mytimer->stopTimer();
//COM_errorLog("End of Listing - time:$exectime");
}
// Display Forums
if ($forum > 0) {
$topiclisting = COM_newTemplate(CTL_plugin_templatePath('forum'));
$topiclisting->set_file(array('topiclisting' => 'topiclisting.thtml', 'forum_icons' => 'forum_icons.thtml', 'forum_links' => 'forum_links.thtml'));
$topiclisting->set_block('topiclisting', 'topic_record');
$topiclisting->set_block('topiclisting', 'no_records_message');
$blocks = array('new_icon', 'quiet_icon', 'active_icon', 'normal_icon', 'normalnew_icon', 'sticky_icon', 'stickynew_icon', 'locked_icon', 'lockednew_icon', 'sort_desc', 'sort_desc_on', 'sort_asc', 'sort_asc_on');
foreach ($blocks as $block) {
$topiclisting->set_block('forum_icons', $block);
}
$blocks = array('newtopic_link', 'subscribeforum_link', 'forummenu_link');
foreach ($blocks as $block) {
$topiclisting->set_block('forum_links', $block);
}
$topiclisting->set_var('imgset', $CONF_FORUM['imgset']);
$topiclisting->set_var('layout_url', $CONF_FORUM['layout_url']);
$topiclisting->set_var('LANG_HOME', $LANG_GF01['HOMEPAGE']);
$topiclisting->set_var('forum_home', $LANG_GF01['INDEXPAGE']);
示例5: links_list
/**
* Create the links list depending on the category given
*
* @param array $message message(s) to display
* @return string the links page
*
*/
function links_list($message)
{
global $_CONF, $_TABLES, $_LI_CONF, $LANG_LINKS_ADMIN, $LANG_LINKS, $LANG_LINKS_STATS;
$cid = $_LI_CONF['root'];
$display = '';
if (isset($_GET['category'])) {
$cid = strip_tags(COM_stripslashes($_GET['category']));
} elseif (isset($_POST['category'])) {
$cid = strip_tags(COM_stripslashes($_POST['category']));
}
$cat = DB_escapeString($cid);
$page = 0;
if (isset($_GET['page'])) {
$page = COM_applyFilter($_GET['page'], true);
}
if ($page == 0) {
$page = 1;
}
if (empty($cid)) {
if ($page > 1) {
$page_title = sprintf($LANG_LINKS[114] . ' (%d)', $page);
} else {
$page_title = $LANG_LINKS[114];
}
} else {
if ($cid == $_LI_CONF['root']) {
$category = $LANG_LINKS['root'];
} else {
$category = DB_getItem($_TABLES['linkcategories'], 'category', "cid = '{$cat}'");
}
if ($page > 1) {
$page_title = sprintf($LANG_LINKS[114] . ': %s (%d)', $category, $page);
} else {
$page_title = sprintf($LANG_LINKS[114] . ': %s', $category);
}
}
// Check has access and existent to this category
if ($cid != $_LI_CONF['root']) {
$result = DB_query("SELECT owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon FROM {$_TABLES['linkcategories']} WHERE cid='{$cat}'");
$A = DB_fetchArray($result);
if (SEC_hasAccess($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']) < 2) {
$display .= COM_showMessage(5, 'links');
$display = COM_createHTMLDocument($display, array('pagetitle' => $page_title));
COM_output($display);
exit;
}
// check existent
if (!isset($A['owner_id'])) {
$display .= COM_showMessage(16, 'links');
$display = COM_createHTMLDocument($display, array('pagetitle' => $page_title));
COM_output($display);
exit;
}
}
if (is_array($message) && !empty($message[0])) {
$display .= COM_showMessageText($message[1], $message[0]);
} else {
if (isset($_REQUEST['msg'])) {
$msg = COM_applyFilter($_REQUEST['msg'], true);
if ($msg > 0) {
$display .= COM_showMessage($msg, 'links');
}
}
}
$linklist = COM_newTemplate(CTL_plugin_templatePath('links'));
$linklist->set_file(array('linklist' => 'links.thtml', 'catlinks' => 'categorylinks.thtml', 'link' => 'linkdetails.thtml', 'catnav' => 'categorynavigation.thtml', 'catrow' => 'categoryrow.thtml', 'catcol' => 'categorycol.thtml', 'actcol' => 'categoryactivecol.thtml', 'pagenav' => 'pagenavigation.thtml', 'catdrop' => 'categorydropdown.thtml'));
$linklist->set_var('blockheader', COM_startBlock($LANG_LINKS[114]));
if ($_LI_CONF['linkcols'] > 0) {
// Create breadcrumb trail
$linklist->set_var('breadcrumbs', links_breadcrumbs($_LI_CONF['root'], $cid));
// Set dropdown for category jump
$linklist->set_var('lang_go', $LANG_LINKS[124]);
$linklist->set_var('link_dropdown', links_select_box(2, $cid));
// Show categories
$sql = "SELECT cid,pid,category,description FROM {$_TABLES['linkcategories']} WHERE pid='{$cat}'";
$sql .= COM_getLangSQL('cid', 'AND');
$sql .= COM_getPermSQL('AND') . " ORDER BY category";
$result = DB_query($sql);
$nrows = DB_numRows($result);
if ($nrows > 0) {
$linklist->set_var('lang_categories', $LANG_LINKS_ADMIN[14]);
for ($i = 1; $i <= $nrows; $i++) {
$C = DB_fetchArray($result);
// Get number of child links user can see in this category
$ccid = DB_escapeString($C['cid']);
$result1 = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['links']} WHERE cid='{$ccid}'" . COM_getPermSQL('AND'));
$D = DB_fetchArray($result1);
// Get number of child categories user can see in this category
$result2 = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['linkcategories']} WHERE pid='{$ccid}'" . COM_getPermSQL('AND'));
$E = DB_fetchArray($result2);
// Format numbers for display
$display_count = '';
// don't show zeroes
//.........这里部分代码省略.........
示例6: editpersonalevent
/**
* Allows user to edit a personal calendar event
*
* @param array $A Record to display
* @return string HTML for event editor
*
*/
function editpersonalevent($A)
{
global $_CONF, $_CA_CONF, $LANG_CAL_1;
$cal_templates = COM_newTemplate(CTL_plugin_templatePath('calendar'));
$cal_templates->set_file('form', 'editpersonalevent.thtml');
$cal_templates->set_var('lang_title', $LANG_CAL_1[28]);
$title = stripslashes($A['title']);
$title = str_replace('{', '{', $title);
$title = str_replace('}', '}', $title);
$title = str_replace('"', '"', $title);
$cal_templates->set_var('event_title', $title);
$cal_templates->set_var('lang_eventtype', $LANG_CAL_1[37]);
$type_options = CALENDAR_eventTypeList($A['event_type']);
$cal_templates->set_var('type_options', $type_options);
// Handle start date/time
$cal_templates->set_var('lang_startdate', $LANG_CAL_1[21]);
$cal_templates->set_var('lang_starttime', $LANG_CAL_1[30]);
$A['startdate'] = $A['datestart'] . ' ' . $A['timestart'];
$start_month = date('n', strtotime($A['startdate']));
$month_options = COM_getMonthFormOptions($start_month);
$cal_templates->set_var('startmonth_options', $month_options);
$start_day = date('j', strtotime($A['startdate']));
$day_options = COM_getDayFormOptions($start_day);
$cal_templates->set_var('startday_options', $day_options);
$start_year = date('Y', strtotime($A['startdate']));
$year_options = COM_getYearFormOptions($start_year);
$cal_templates->set_var('startyear_options', $year_options);
if (isset($_CA_CONF['hour_mode']) && $_CA_CONF['hour_mode'] == 24) {
$start_hour = date('H', strtotime($A['startdate']));
$hour_options = COM_getHourFormOptions($start_hour, 24);
$cal_templates->set_var('starthour_options', $hour_options);
} else {
$start_hour = date('g', strtotime($A['startdate']));
$hour_options = COM_getHourFormOptions($start_hour);
$cal_templates->set_var('starthour_options', $hour_options);
}
$startmin = intval(date('i', strtotime($A['startdate'])) / 15) * 15;
$cal_templates->set_var('startminute_options', COM_getMinuteFormOptions($startmin, 15));
$ampm = date('a', strtotime($A['startdate']));
$cal_templates->set_var('startampm_selection', COM_getAmPmFormSelection('startampm_selection', $ampm));
// Handle end date/time
$cal_templates->set_var('lang_enddate', $LANG_CAL_1[18]);
$cal_templates->set_var('lang_endtime', $LANG_CAL_1[29]);
$A['enddate'] = $A['dateend'] . ' ' . $A['timeend'];
$end_month = date('n', strtotime($A['enddate']));
$month_options = COM_getMonthFormOptions($end_month);
$cal_templates->set_var('endmonth_options', $month_options);
$end_day = date('j', strtotime($A['enddate']));
$day_options = COM_getDayFormOptions($end_day);
$cal_templates->set_var('endday_options', $day_options);
$end_year = date('Y', strtotime($A['enddate']));
$year_options = COM_getYearFormOptions($end_year);
$cal_templates->set_var('endyear_options', $year_options);
if (isset($_CA_CONF['hour_mode']) && $_CA_CONF['hour_mode'] == 24) {
$end_hour = date('H', strtotime($A['enddate']));
$hour_options = COM_getHourFormOptions($end_hour, 24);
$cal_templates->set_var('endhour_options', $hour_options);
} else {
$end_hour = date('g', strtotime($A['enddate']));
$hour_options = COM_getHourFormOptions($end_hour);
$cal_templates->set_var('endhour_options', $hour_options);
}
$endmin = intval(date('i', strtotime($A['enddate'])) / 15) * 15;
$cal_templates->set_var('endminute_options', COM_getMinuteFormOptions($endmin, 15));
$ampm = date('a', strtotime($A['enddate']));
$cal_templates->set_var('endampm_selection', COM_getAmPmFormSelection('endampm_selection', $ampm));
$cal_templates->set_var('lang_alldayevent', $LANG_CAL_1[31]);
if ($A['allday'] == 1) {
$cal_templates->set_var('allday_checked', 'checked="checked"');
} else {
$cal_templates->set_var('allday_checked', '');
}
$cal_templates->set_var('lang_location', $LANG_CAL_1[39]);
$cal_templates->set_var('event_location', stripslashes($A['location']));
$cal_templates->set_var('lang_addressline1', $LANG_CAL_1[32]);
$cal_templates->set_var('event_address1', stripslashes($A['address1']));
$cal_templates->set_var('lang_addressline2', $LANG_CAL_1[33]);
$cal_templates->set_var('event_address2', stripslashes($A['address2']));
$cal_templates->set_var('lang_city', $LANG_CAL_1[34]);
$cal_templates->set_var('event_city', stripslashes($A['city']));
$cal_templates->set_var('lang_state', $LANG_CAL_1[35]);
$cal_templates->set_var('state_options', '');
$cal_templates->set_var('event_state', stripslashes($A['state']));
$cal_templates->set_var('lang_zipcode', $LANG_CAL_1[36]);
$cal_templates->set_var('event_zipcode', $A['zipcode']);
$cal_templates->set_var('lang_link', $LANG_CAL_1[43]);
$cal_templates->set_var('event_url', $A['url']);
$cal_templates->set_var('lang_description', $LANG_CAL_1[5]);
$cal_templates->set_var('event_description', COM_nl2br(stripslashes($A['description'])));
$cal_templates->set_var('lang_htmlnotallowed', $LANG_CAL_1[44]);
$cal_templates->set_var('lang_submit', $LANG_CAL_1[45]);
$cal_templates->set_var('lang_delete', $LANG_CAL_1[51]);
$cal_templates->set_var('eid', $A['eid']);
//.........这里部分代码省略.........
示例7: gf_createHTMLDocument
$report->set_var('post_subject', $P['subject']);
$report->set_var('post_end_ahref', '</a>');
$report->set_var('post_date', $postdate[0]);
$report->set_var('post_replies', $P['replies']);
$report->set_var('post_views', $P['views']);
$report->set_var('csscode', $i % 2 + 1);
$report->parse('report_record', 'report_record', true);
}
}
$report->parse('output', 'report');
$display .= $report->finish($report->get_var('output'));
$display = gf_createHTMLDocument($display);
COM_output($display);
exit;
} else {
$report = COM_newTemplate(CTL_plugin_templatePath('forum'));
$report->set_file(array('report' => 'reports/memberlist.thtml', 'forum_icons' => 'forum_icons.thtml', 'forum_links' => 'forum_links.thtml'));
$report->set_block('report', 'report_record');
$report->set_block('forum_links', 'memberoption_link');
$blocks = array('sort_desc', 'sort_desc_on', 'sort_asc', 'sort_asc_on');
foreach ($blocks as $block) {
$report->set_block('forum_icons', $block);
}
// Check if the number of records was specified to show
if (empty($show) and $CONF_FORUM['show_members_perpage'] > 0) {
$show = $CONF_FORUM['show_members_perpage'];
} elseif (empty($show)) {
$show = 20;
}
// Check if this is the first page.
if ($page == 0) {
示例8: f_forumrules
function f_forumrules()
{
global $_CONF, $_USER, $LANG_GF01, $LANG_GF02, $CONF_FORUM;
$forum_rules = COM_newTemplate(CTL_plugin_templatePath('forum'));
$forum_rules->set_file(array('forum_rules' => 'footer/forum_rules.thtml', 'forum_icons' => 'forum_icons.thtml'));
$blocks = array('status_yes', 'status_no');
foreach ($blocks as $block) {
$forum_rules->set_block('forum_icons', $block);
}
if ($CONF_FORUM['registered_to_post'] and ($_USER['uid'] < 2 or empty($_USER['uid']))) {
$postperm_msg = $LANG_GF01['POST_PERM_MSG2'];
$post_perm_image = "status_no";
} else {
$postperm_msg = $LANG_GF01['POST_PERM_MSG1'];
$post_perm_image = "status_yes";
}
if ($CONF_FORUM['allow_html']) {
$html_perm_image = "status_yes";
if ($CONF_FORUM['use_glfilter']) {
$htmlmsg = $LANG_GF01['HTML_FILTER_MSG'];
} else {
$htmlmsg = $LANG_GF01['HTML_FULL_MSG'];
}
} else {
$htmlmsg = $LANG_GF01['HTML_MSG'];
$html_perm_image = "status_no";
}
if ($CONF_FORUM['use_censor']) {
$censor_perm_image = "status_yes";
} else {
$censor_perm_image = "status_no";
}
if ($CONF_FORUM['show_anonymous_posts']) {
$anon_perm_image = "status_yes";
} else {
$anon_perm_image = "status_no";
}
$forum_rules->set_var('imgset', $CONF_FORUM['imgset']);
$forum_rules->set_var('LANG_title', $LANG_GF02['msg101']);
$forum_rules->set_var('anonymous_msg', $LANG_GF01['ANON_PERM_MSG']);
$forum_rules->parse('anon_perm_image', $anon_perm_image);
$forum_rules->set_var('postingperm_msg', $postperm_msg);
$forum_rules->parse('post_perm_image', $post_perm_image);
$forum_rules->set_var('html_msg', $htmlmsg);
$forum_rules->parse('html_perm_image', $html_perm_image);
$forum_rules->set_var('censor_msg', $LANG_GF01['CENSOR_PERM_MSG']);
$forum_rules->parse('censor_perm_image', $censor_perm_image);
$forum_rules->parse('output', 'forum_rules');
return $forum_rules->finish($forum_rules->get_var('output'));
}
示例9: gf_getImage
$topic_footer->set_var('newtopiclink', $newtopiclink);
$topic_footer->set_var('newtopiclinkimg', gf_getImage('post_newtopic'));
$topic_footer->set_var('newtopiclinktext', $newtopiclinktext);
$topic_footer->set_var('LANG_newtopic', $LANG_GF01['NEWTOPIC']);
$topic_footer->parse('newtopic_link', 'newtopic_link');
if ($viewtopic['locked'] != 1) {
$replytopiclink = "{$_CONF['site_url']}/forum/createtopic.php?method=postreply&forum={$forum}&id={$replytopic_id}";
$topic_footer->set_var('replytopiclink', $replytopiclink);
$topic_footer->set_var('replytopiclinkimg', gf_getImage('post_reply'));
$topic_footer->set_var('replytopiclinktext', $LANG_GF09['replytopic']);
$topic_footer->set_var('LANG_reply', $LANG_GF01['POSTREPLY']);
$topic_footer->parse('replytopic_link', 'replytopic_link');
}
}
} else {
$topic_footer = COM_newTemplate(CTL_plugin_templatePath('forum'));
$topic_footer->set_file(array('topicfooter' => 'topicfooter_preview.thtml'));
}
$topic_footer->set_var('pagenavigation', $pagenavigation);
$topic_footer->set_var('forum_id', $forum);
$topic_footer->set_var('imgset', $CONF_FORUM['imgset']);
$topic_footer->parse('output', 'topicfooter');
$display .= $topic_footer->finish($topic_footer->get_var('output'));
$intervalTime = $mytimer->stopTimer();
//COM_errorLog("End Topic Display Time: $intervalTime");
if ($onlytopic != 1) {
$display .= BaseFooter();
$display = gf_createHTMLDocument($display, $subject);
} else {
// need to call this incase plugin doesnt use script class OR footercode function is used to set required javascript file
$display .= PLG_getFooterCode();
示例10: plugin_submit_calendar
break;
case 'addentry':
$display .= plugin_submit_calendar($mode);
$display = COM_createHTMLDocument($display, array('pagetitle' => $pagetitle));
break;
case 'savepersonal':
if (SEC_checkToken()) {
$display = plugin_savesubmission_calendar($_POST);
} else {
COM_redirect($_CONF['site_url'] . '/calendar/index.php');
}
break;
default:
// month view
// Load templates
$cal_templates = COM_newTemplate(CTL_plugin_templatePath('calendar'));
$cal_templates->set_file(array('calendar' => 'calendar.thtml', 'week' => 'calendarweek.thtml', 'day' => 'calendarday.thtml', 'event' => 'calendarevent.thtml', 'mastercal' => 'mastercalendaroption.thtml', 'personalcal' => 'personalcalendaroption.thtml', 'addevent' => 'addeventoption.thtml'));
$cal_templates->set_var('mode', $mode);
if ($mode == 'personal') {
$cal_templates->set_var('start_block', COM_startBlock($LANG_CAL_2[12]));
$cal_templates->set_var('end_block', COM_endBlock());
} else {
$cal_templates->set_var('start_block', COM_startBlock($LANG_CAL_2[11]));
$cal_templates->set_var('end_block', COM_endBlock());
}
$smallcal_prev = getSmallCalendar($prevmonth, $prevyear, $mode);
$cal_templates->set_var('previous_months_calendar', $smallcal_prev);
$smallcal_next = getSmallCalendar($nextmonth, $nextyear, $mode);
$cal_templates->set_var('next_months_calendar', $smallcal_next);
$cal_templates->set_var('cal_prevmo_num', $prevmonth);
$cal_templates->set_var('cal_prevyr_num', $prevyear);
示例11: editpoll
/**
* Shows poll editor
*
* Diplays the poll editor form
*
* @param string $pid ID of poll to edit
* @return string HTML for poll editor form
*
*/
function editpoll($pid = '')
{
global $_CONF, $_PO_CONF, $_GROUPS, $_TABLES, $_USER, $LANG25, $LANG_ACCESS, $LANG_ADMIN, $MESSAGE, $LANG_POLLS, $_SCRIPTS;
$retval = '';
if (!empty($pid)) {
$topic = DB_query("SELECT * FROM {$_TABLES['polltopics']} WHERE pid='{$pid}'");
$T = DB_fetchArray($topic);
// Get permissions for poll
$access = SEC_hasAccess($T['owner_id'], $T['group_id'], $T['perm_owner'], $T['perm_group'], $T['perm_members'], $T['perm_anon']);
if ($access == 0 or $access == 2) {
// User doesn't have access...bail
$retval .= COM_showMessageText($LANG25[22], $LANG25[21]);
COM_accessLog("User {$_USER['username']} tried to illegally submit or edit poll {$pid}.");
return $retval;
}
}
// writing the menu on top
require_once $_CONF['path_system'] . 'lib-admin.php';
$menu_arr = array(array('url' => $_CONF['site_admin_url'] . '/plugins/polls/index.php', 'text' => $LANG_ADMIN['list_all']), array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home']));
$token = SEC_createToken();
$retval .= COM_startBlock($LANG25[5], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= ADMIN_createMenu($menu_arr, $LANG_POLLS['editinstructions'], plugin_geticon_polls());
$retval .= SEC_getTokenExpiryNotice($token);
$poll_templates = COM_newTemplate(CTL_plugin_templatePath('polls', 'admin'));
$poll_templates->set_file(array('editor' => 'polleditor.thtml', 'question' => 'pollquestions.thtml', 'answer' => 'pollansweroption.thtml'));
if (!empty($pid) and $access == 3 and !empty($T['owner_id'])) {
$delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete'] . '" name="mode"%s' . XHTML . '>';
$jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"';
$poll_templates->set_var('delete_option', sprintf($delbutton, $jsconfirm));
$poll_templates->set_var('delete_option_no_confirmation', sprintf($delbutton, ''));
$poll_templates->set_var('allow_delete', true);
$poll_templates->set_var('lang_delete', $LANG_ADMIN['delete']);
$poll_templates->set_var('confirm_message', $MESSAGE[76]);
} else {
$T['pid'] = COM_makeSid();
$T['topic'] = '';
$T['description'] = '';
$T['meta_description'] = '';
$T['meta_keywords'] = '';
$T['voters'] = 0;
$T['display'] = 1;
$T['is_open'] = 1;
$T['hideresults'] = 0;
$T['owner_id'] = $_USER['uid'];
if (isset($_GROUPS['Polls Admin'])) {
$T['group_id'] = $_GROUPS['Polls Admin'];
} else {
$T['group_id'] = SEC_getFeatureGroup('polls.edit');
}
SEC_setDefaultPermissions($T, $_PO_CONF['default_permissions']);
$T['statuscode'] = 0;
$T['commentcode'] = $_CONF['comment_code'];
$access = 3;
}
$poll_templates->set_var('noscript', COM_getNoScript(false, ''));
// Add JavaScript
// Hide the Advanced Editor as Javascript is required. If JS is enabled then the JS below will un-hide it
$js = 'document.getElementById("advanced_editor").style.display="";';
$_SCRIPTS->setJavaScript($js, true);
$_SCRIPTS->setJavaScriptFile('polls_editor', '/polls/polls_editor.js');
$poll_templates->set_var('lang_pollid', $LANG25[6]);
$poll_templates->set_var('poll_id', $T['pid']);
$poll_templates->set_var('lang_donotusespaces', $LANG25[7]);
$poll_templates->set_var('lang_topic', $LANG25[9]);
$poll_templates->set_var('poll_topic', htmlspecialchars($T['topic']));
$poll_templates->set_var('lang_mode', $LANG25[1]);
$poll_templates->set_var('lang_topic_description', $LANG25[1003]);
$poll_templates->set_var('topic_description', $T['description']);
$poll_templates->set_var('lang_metadescription', $LANG_ADMIN['meta_description']);
$poll_templates->set_var('lang_metakeywords', $LANG_ADMIN['meta_keywords']);
if (!empty($T['meta_description'])) {
$poll_templates->set_var('meta_description', $T['meta_description']);
}
if (!empty($T['meta_keywords'])) {
$poll_templates->set_var('meta_keywords', $T['meta_keywords']);
}
if ($_CONF['meta_tags'] > 0 && $_PO_CONF['meta_tags'] > 0) {
$poll_templates->set_var('hide_meta', '');
} else {
$poll_templates->set_var('hide_meta', ' style="display:none;"');
}
$poll_templates->set_var('status_options', COM_optionList($_TABLES['statuscodes'], 'code,name', $T['statuscode']));
$poll_templates->set_var('comment_options', COM_optionList($_TABLES['commentcodes'], 'code,name', $T['commentcode']));
$poll_templates->set_var('lang_appearsonhomepage', $LANG25[8]);
$poll_templates->set_var('lang_openforvoting', $LANG25[33]);
$poll_templates->set_var('lang_hideresults', $LANG25[37]);
$poll_templates->set_var('poll_hideresults_explain', $LANG25[38]);
$poll_templates->set_var('poll_topic_info', $LANG25[39]);
if ($T['display'] == 1) {
$poll_templates->set_var('poll_display', 'checked="checked"');
}
//.........这里部分代码省略.........
示例12: elseif
exit;
} elseif ($modfunction == 'banippost' and forum_modPermission($forum, $_USER['uid'], 'mod_ban') and $fortopicid != 0) {
$iptobansql = DB_query("SELECT ip FROM {$_TABLES['forum_topic']} WHERE id='{$fortopicid}'");
$forumpostipnum = DB_fetchArray($iptobansql);
if ($forumpostipnum['ip'] == '') {
$display .= alertMessage($LANG_GF02['msg174']);
exit;
}
$alertmessage = $LANG_GF02['msg68'];
$ip_address = $forumpostipnum['ip'];
if (!empty($_CONF['ip_lookup'])) {
$iplookup = str_replace('*', $ip_address, $_CONF['ip_lookup']);
$ip_address = COM_createLink($ip_address, $iplookup);
}
$alertmessage .= sprintf($LANG_GF02['msg69'], $ip_address);
$page = COM_newTemplate(CTL_plugin_templatePath('forum', 'moderator'));
$page->set_file(array('page' => 'ban.thtml'));
$page->set_var('hostip', $forumpostipnum['ip']);
$page->set_var('forum', $forum);
$page->set_var('fortopicid', $fortopicid);
$page->parse('output', 'page');
$promptform = $page->finish($page->get_var('output'));
$display .= alertMessage($alertmessage, $LANG_GF02['msg182'], $promptform);
} else {
$display .= alertMessage($LANG_GF02['msg71'], $LANG_GF01['WARNING']);
}
} else {
$display .= alertMessage($LANG_GF02['msg72'], $LANG_GF01['ACCESSERROR']);
}
$display = gf_createHTMLDocument($display);
COM_output($display);
示例13: SEC_createToken
$addmod->set_var('LANG_DELETE', $LANG_GF01['DELETE']);
$addmod->set_var('gltoken_name', CSRF_TOKEN);
$addmod->set_var('gltoken', SEC_createToken());
$addmod->parse('output', 'moderator');
$display .= $addmod->finish($addmod->get_var('output'));
} else {
$showforumssql = DB_query("SELECT forum_name,forum_id FROM {$_TABLES['forum_forums']}");
$sel_forums = '<option value="0">' . $LANG_GF93['allforums'] . '</option>';
while ($showforum = DB_fetchArray($showforumssql)) {
if ($selected_forum == $showforum['forum_id']) {
$sel_forums .= '<option value="' . $showforum['forum_id'] . '" selected="selected">' . $showforum['forum_name'] . '</option>';
} else {
$sel_forums .= '<option value="' . $showforum['forum_id'] . '">' . $showforum['forum_name'] . '</option>';
}
}
$moderators = COM_newTemplate(CTL_plugin_templatePath('forum'));
$moderators->set_file(array('moderators' => 'admin/moderators.thtml', 'forum_links' => 'forum_links.thtml'));
$moderators->set_block('moderators', 'report_record');
$moderators->set_block('moderators', 'no_records_message');
$moderators->set_block('forum_links', 'trash_link');
$moderators->set_var('action_url', $_CONF['site_admin_url'] . '/plugins/forum/mods.php');
$moderators->set_var('imgset', $CONF_FORUM['imgset']);
$moderators->set_var('userfilter', '');
if ($filtermode == 'group') {
$moderators->set_var('groupfilter', 'checked="checked"');
$moderators->set_var('LANG_HEADING2', $LANG_GF01['GROUP']);
} else {
$moderators->set_var('userfilter', 'checked="checked"');
$moderators->set_var('LANG_HEADING2', $LANG_GF01['USER']);
}
$moderators->set_var('LANG_filtertitle', $LANG_GF93['filtertitle']);
示例14: staticpageeditor_form
/**
* Displays the static page editor form
*
* @param array $A Data to display
* @return string HTML for the static page editor
*
*/
function staticpageeditor_form($A)
{
global $_CONF, $_TABLES, $_USER, $_GROUPS, $_SP_CONF, $mode, $sp_id, $LANG21, $LANG_STATIC, $LANG_ACCESS, $LANG_ADMIN, $LANG01, $LANG24, $LANG_postmodes, $MESSAGE, $_IMAGE_TYPE, $_SCRIPTS;
if (!empty($sp_id) && $mode == 'edit') {
$access = SEC_hasAccess($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']);
} else {
if ($mode != 'clone') {
$A['sp_inblock'] = $_SP_CONF['in_block'];
}
$A['owner_id'] = $_USER['uid'];
if (isset($_GROUPS['Static Page Admin'])) {
$A['group_id'] = $_GROUPS['Static Page Admin'];
} else {
$A['group_id'] = SEC_getFeatureGroup('staticpages.edit');
}
SEC_setDefaultPermissions($A, $_SP_CONF['default_permissions']);
$access = 3;
if ($_CONF['advanced_editor'] && $_USER['advanced_editor']) {
$A['advanced_editor_mode'] = 1;
}
}
$retval = '';
$sp_template = COM_newTemplate(CTL_plugin_templatePath('staticpages', 'admin'));
if ($_CONF['advanced_editor'] && $_USER['advanced_editor']) {
$sp_template->set_file('form', 'editor_advanced.thtml');
// Shouldn't really have to check if anonymous user but who knows...
if (COM_isAnonUser()) {
$link_message = "";
} else {
$link_message = $LANG01[138];
}
$sp_template->set_var('noscript', COM_getNoScript(false, '', $link_message));
// Setup Advanced Editor
COM_setupAdvancedEditor('/staticpages/adveditor.js', 'staticpages.edit');
$sp_template->set_var('lang_expandhelp', $LANG24[67]);
$sp_template->set_var('lang_reducehelp', $LANG24[68]);
$sp_template->set_var('lang_toolbar', $LANG24[70]);
$sp_template->set_var('toolbar1', $LANG24[71]);
$sp_template->set_var('toolbar2', $LANG24[72]);
$sp_template->set_var('toolbar3', $LANG24[73]);
$sp_template->set_var('toolbar4', $LANG24[74]);
$sp_template->set_var('toolbar5', $LANG24[75]);
$sp_template->set_var('lang_nojavascript', $LANG24[77]);
$sp_template->set_var('lang_postmode', $LANG24[4]);
if (isset($A['postmode']) && $A['postmode'] == 'adveditor') {
$sp_template->set_var('show_adveditor', '');
$sp_template->set_var('show_htmleditor', 'none');
} else {
$sp_template->set_var('show_adveditor', 'none');
$sp_template->set_var('show_htmleditor', '');
}
$post_options = '<option value="html" selected="selected">' . $LANG_postmodes['html'] . '</option>';
if (isset($A['postmode']) && $A['postmode'] == 'adveditor') {
$post_options .= '<option value="adveditor" selected="selected">' . $LANG24[86] . '</option>';
} else {
$post_options .= '<option value="adveditor">' . $LANG24[86] . '</option>';
}
$sp_template->set_var('post_options', $post_options);
$sp_template->set_var('change_editormode', 'onchange="change_editmode(this);"');
} else {
$sp_template->set_file('form', 'editor.thtml');
}
// Add JavaScript
if ($_CONF['titletoid']) {
$_SCRIPTS->setJavaScriptFile('title_2_id', '/javascript/title_2_id.js');
$sp_template->set_var('titletoid', true);
}
$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&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', '');
}
//.........这里部分代码省略.........
示例15: CALENDAR_editEvent
/**
* Shows event editor
*
* @param string $mode Indicates if this is a submission or a regular entry
* @param array $A array holding the event's details
* @param string $msg an optional error message to display
* @return string HTML for event editor or error message
*
*/
function CALENDAR_editEvent($mode, $A, $msg = '')
{
global $_CONF, $_GROUPS, $_TABLES, $_USER, $_CA_CONF, $LANG_CAL_1, $LANG_CAL_ADMIN, $LANG10, $LANG12, $LANG_ACCESS, $LANG_ADMIN, $MESSAGE, $_SCRIPTS;
// Loads jQuery UI datepicker and timepicker-addon
$_SCRIPTS->setJavaScriptLibrary('jquery.ui.slider');
$_SCRIPTS->setJavaScriptLibrary('jquery.ui.datepicker');
$_SCRIPTS->setJavaScriptLibrary('jquery-ui-i18n');
$_SCRIPTS->setJavaScriptLibrary('jquery-ui-timepicker-addon');
$_SCRIPTS->setJavaScriptLibrary('jquery-ui-timepicker-addon-i18n');
$_SCRIPTS->setJavaScriptFile('datetimepicker', '/javascript/datetimepicker.js');
// Add JavaScript
$_SCRIPTS->setJavaScriptFile('postmode_control', '/javascript/postmode_control.js');
$langCode = COM_getLangIso639Code();
$toolTip = $MESSAGE[118];
$imgUrl = $_CONF['site_url'] . '/images/calendar.png';
$_SCRIPTS->setJavaScript("jQuery(function () {" . " geeklog.hour_mode = {$_CONF['hour_mode']};" . " geeklog.datetimepicker.options.stepMinute = 15;" . " geeklog.datetimepicker.set('start', '{$langCode}', '{$toolTip}', '{$imgUrl}');" . " geeklog.datetimepicker.set('end', '{$langCode}', '{$toolTip}', '{$imgUrl}');" . "});", TRUE, TRUE);
$retval = '';
if (!empty($msg)) {
$retval .= COM_showMessageText($msg, $LANG_CAL_ADMIN[2]);
}
$event_templates = COM_newTemplate(CTL_plugin_templatePath('calendar', 'admin'));
$event_templates->set_file('editor', 'eventeditor.thtml');
$allowed = '';
foreach (array('plaintext', 'html') as $pm) {
$allowed .= COM_allowedHTML('calendar.edit', false, 1, $pm);
}
$allowed .= COM_allowedAutotags();
$event_templates->set_var('lang_allowed_html', $allowed);
$event_templates->set_var('lang_postmode', $LANG_CAL_ADMIN[3]);
if ($mode != 'editsubmission' and !empty($A['eid'])) {
// Get what level of access user has to this object
$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) {
// Uh, oh! User doesn't have access to this object
$retval .= COM_showMessageText($LANG_CAL_ADMIN[17], $LANG_ACCESS['accessdenied']);
COM_accessLog("User {$_USER['username']} tried to illegally submit or edit event {$eid}.");
return $retval;
}
} else {
if (empty($A['owner_id'])) {
$A['owner_id'] = $_USER['uid'];
}
if (isset($_GROUPS['Calendar Admin'])) {
$A['group_id'] = $_GROUPS['Calendar Admin'];
} else {
$A['group_id'] = SEC_getFeatureGroup('calendar.edit');
}
SEC_setDefaultPermissions($A, $_CA_CONF['default_permissions']);
$access = 3;
}
if ($mode == 'editsubmission') {
$event_templates->set_var('post_options', COM_optionList($_TABLES['postmodes'], 'code,name', 'plaintext'));
} else {
if (!isset($A['postmode'])) {
$A['postmode'] = $_CONF['postmode'];
}
$event_templates->set_var('post_options', COM_optionList($_TABLES['postmodes'], 'code,name', $A['postmode']));
}
$token = SEC_createToken();
$retval .= COM_startBlock($LANG_CAL_ADMIN[1], '', COM_getBlockTemplate('_admin_block', 'header'));
$retval .= SEC_getTokenExpiryNotice($token);
if (!empty($A['eid'])) {
$delbutton = '<input type="submit" value="' . $LANG_ADMIN['delete'] . '" name="mode"%s' . XHTML . '>';
$jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"';
$event_templates->set_var('delete_option', sprintf($delbutton, $jsconfirm));
$event_templates->set_var('delete_option_no_confirmation', sprintf($delbutton, ''));
$event_templates->set_var('allow_delete', true);
$event_templates->set_var('lang_delete', $LANG_ADMIN['delete']);
$event_templates->set_var('confirm_message', $MESSAGE[76]);
if ($mode == 'editsubmission') {
$event_templates->set_var('submission_option', '<input type="hidden" name="type" value="submission"' . XHTML . '>');
}
} else {
// new event
$A['eid'] = COM_makesid();
$A['title'] = '';
$A['description'] = '';
$A['url'] = '';
$A['hits'] = 0;
// in case a start date/time has been passed from the calendar,
// pick it up for the end date/time
if (empty($A['dateend'])) {
$A['dateend'] = $A['datestart'];
}
if (empty($A['timeend'])) {
$A['timeend'] = $A['timestart'];
}
$A['event_type'] = '';
$A['location'] = '';
$A['address1'] = '';
$A['address2'] = '';
//.........这里部分代码省略.........