本文整理汇总了PHP中add_to_footer函数的典型用法代码示例。如果您正苦于以下问题:PHP add_to_footer函数的具体用法?PHP add_to_footer怎么用?PHP add_to_footer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_to_footer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_blog_item
function display_blog_item($info)
{
global $locale, $blog_settings;
add_to_head("<link rel='stylesheet' href='" . INFUSIONS . "blog/templates/css/blog.css' type='text/css'>");
add_to_head("<link rel='stylesheet' href='" . INCLUDES . "jquery/colorbox/colorbox.css' type='text/css' media='screen' />");
add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/colorbox/jquery.colorbox.js'></script>");
add_to_footer('<script type="text/javascript">
$(document).ready(function() {
$(".blog-image-overlay").colorbox({
transition: "elasic",
height:"100%",
width:"100%",
maxWidth:"98%",
maxHeight:"98%",
scrolling:false,
overlayClose:true,
close:false,
photo:true,
onComplete: function(result) {
$("#colorbox").live("click", function(){
$(this).unbind("click");
$.fn.colorbox.close();
});
},
onLoad: function () {
}
});
});
</script>');
ob_start();
$data = $info['blog_item'];
echo "<div class='clearfix'>\n\t\t\t\t<div class='btn-group pull-right'>\n\t\t\t\t<a class='btn btn-default btn-sm' href='" . $data['print_link'] . "'>" . $locale['print'] . "</a>";
if ($data['admin_link']) {
$admin_actions = $data['admin_link'];
echo "<a class='btn btn-default btn-sm' href='" . $admin_actions['edit'] . "'>" . $locale['edit'] . "</a>\n";
echo "<a class='btn btn-default btn-sm' href='" . $admin_actions['delete'] . "'>" . $locale['delete'] . "</a>\n";
}
echo "</div>";
echo "<div class='overflow-hide'>\n\t\t\t\t<h2 class='strong m-t-0 m-b-0'>" . $data['blog_subject'] . "</h2>\n\t\t\t\t<div class='blog-category'>" . $data['blog_category_link'] . "</div>\n\t\t\t\t<div class='m-t-20 m-b-20'>" . $data['blog_post_author'] . " " . $data['blog_post_time'] . "</div>\n\t\t\t</div>\n\t\t</div>";
echo "<div class='clearfix m-b-20'>\n";
if ($data['blog_image']) {
echo "<a class='m-10 " . $data['blog_ialign'] . " blog-image-overlay' href='" . $data['blog_image_link'] . "'>";
echo "<img class='img-responsive' src='" . $data['blog_image_link'] . "' alt='" . $data['blog_subject'] . "' style='padding:5px; max-height:" . $blog_settings['blog_photo_h'] . "px; overflow:hidden;' />\n </a>";
}
echo parse_textarea($data['blog_extended'], FALSE, FALSE);
echo "</div>\n";
if ($info['blog_nav']) {
echo "<div class='clearfix m-b-20'>\n<div class='pull-right'>\n" . $info['blog_nav'] . "</div>\n</div>\n";
}
echo "<div class='m-b-20 well'>" . $data['blog_author_info'] . "</div>";
if ($data['blog_allow_comments']) {
echo "<hr /> " . showcomments("B", DB_BLOG, "blog_id", $_GET['readmore'], INFUSIONS . "blog/blog.php?readmore=" . $_GET['readmore']) . "";
}
if ($data['blog_allow_ratings']) {
echo "<hr /> " . showratings("B", $_GET['readmore'], INFUSIONS . "blog/blog.php?readmore=" . $_GET['readmore']) . "";
}
$str = ob_get_contents();
ob_end_clean();
return $str;
}
示例2: form_fileinput
function form_fileinput($title = false, $input_name, $input_id, $upload_path, $input_value = false, $array = false)
{
$title = isset($title) && !empty($title) ? stripinput($title) : "";
$title2 = isset($title) && !empty($title) ? stripinput($title) : ucfirst(strtolower(str_replace("_", " ", $input_name)));
$input_name = isset($input_name) && !empty($input_name) ? stripinput($input_name) : "";
// ok, start
if (!defined('form_fileinput')) {
add_to_head("<link href='" . DYNAMICS . "assets/fileinput/css/fileinput.min.css' media='all' rel='stylesheet' type='text/css' />");
add_to_footer("<script src='" . DYNAMICS . "assets/fileinput/js/fileinput.min.js' type='text/javascript'></script>");
define('form_fileinput', true);
}
// 4 choices to sub-array
// a. icon, b. button, c.dropdown list d.dropdown with modal
if (!is_array($array)) {
$array = array();
$required = 0;
$safemode = 1;
$deactivate = "";
$width = "";
$label = 'Browse ...';
$class = 'btn btn-primary btn-sm';
$helper_text = '';
$inline = '';
$url = '';
$type = 'image';
$max_size = '';
} else {
$deactivate = array_key_exists('deactivate', $array) ? $array['deactivate'] : "";
$label = array_key_exists('label', $array) ? $array['label'] : 'Browse ...';
$class = array_key_exists('class', $array) ? $array['class'] : 'btn-primary';
$required = array_key_exists('required', $array) && $array['required'] == 1 ? '1' : '0';
$safemode = array_key_exists('safemode', $array) && $array['safemode'] == 1 ? '1' : '0';
$width = array_key_exists('width', $array) ? $array['width'] : "";
$helper_text = array_key_exists("helper", $array) ? $array['helper'] : "";
$inline = array_key_exists('rowstart', $array) ? 1 : 0;
$url = array_key_exists('url', $array) ? $array['url'] : '';
// for ajax uplaod file path
$type = array_key_exists('image', $array) && $array['image'] == 1 ? 'image' : 'files';
// image only or all mimes.
$max_size = array_key_exists('max_size', $array) && $array['max_size'] ? $array['max_size'] : '3145728';
// defaults to 3mb
}
$html = '';
$html .= "<div id='{$input_id}-field' class='form-group m-b-0'>\n";
$html .= "<label class='control-label " . ($inline ? "col-sm-3 col-md-3 col-lg-3" : '') . "' for='{$input_id}'>{$title} " . ($required == 1 ? "<span class='required'>*</span>" : '') . "</label>\n";
$html .= $inline ? "<div class='col-sm-9 col-md-9 col-lg-9'>\n" : "";
$html .= "<input type='file' name='{$input_name}' id='{$input_id}' class='input-sm file-preview-image' >\n";
$html .= "<input type='hidden' name='def[{$input_name}]' value='[type={$type}],[title={$title2}],[id={$input_id}],[required={$required}],[safemode={$safemode}],[path={$upload_path}],[maxsize={$max_size}]' readonly>";
$html .= "<div id='{$input_id}-help'></div>";
$html .= $inline ? "</div>\n" : "";
$html .= "</div>\n";
add_to_jquery("\n \$('#" . $input_id . "').fileinput({\n previewFileType: 'any',\n browseClass: 'btn btn-sm {$class}',\n uploadClass: 'btn btn-default btn-sm',\n captionClass : 'input-sm',\n removeClass : 'btn btn-sm btn-default',\n browseLabel: '{$label}',\n browseIcon: '<i class=\"entypo cloud m-r-10\"></i>',\n " . ($url ? "uploadUrl : '{$url}'," : '') . "\n " . ($url ? '' : 'showUpload: false') . "\n });\n ");
return $html;
}
示例3: fusion_console
function fusion_console()
{
if (iADMIN && checkrights('ERRO') || iSUPERADMIN) {
$error_logs = new \PHPFusion\ErrorLogs();
$error_logs->compressed = 1;
if (!defined('no_debugger')) {
ob_start();
echo openmodal('tbody', 'Error Console', array('class' => 'modal-lg modal-center zindex-boost', 'button_id' => 'turbo_debugger'));
$error_logs->show_footer_logs();
echo closemodal();
add_to_footer(ob_get_contents());
ob_end_clean();
}
}
}
示例4: openmodal
function openmodal($id, $title, $opts = FALSE)
{
if (!empty($opts)) {
// trigger via button or via load.
if (array_key_exists('button_id', $opts) && $opts['button_id']) {
add_to_jquery("\r\n \$('#" . $opts['button_id'] . "').bind('click', function(e){\r\n \$('#" . $id . "-Modal').modal('show');\r\n });\r\n ");
} else {
add_to_jquery("\r\n \$('#" . $id . "-Modal').modal('show');\r\n ");
}
} else {
add_to_footer("\r\n <script type='text/javascript'>\r\n \$('#" . $id . "-Modal').modal('show');\r\n </script>\r\n ");
}
$html = '';
$html .= "<div class='modal fade' id='{$id}-Modal' tabindex='-1' role='dialog' aria-labelledby='{$id}-ModalLabel' aria-hidden='true'>\n";
$html .= "<div class='modal-dialog modal-lg'>\n";
$html .= "<div class='modal-content'>\n";
$html .= "<div class='modal-header'>";
$html .= "<button type='button' class='btn btn-sm pull-right btn-default' data-dismiss='modal'><i class='entypo cross'></i> Close</button>\n";
$html .= "<h4 class='modal-title text-dark' id='myModalLabel'>{$title}</h4>\n";
$html .= "</div>\n";
$html .= "<div class='modal-body'>\n";
return $html;
}
示例5: displayInput
public function displayInput()
{
global $locale;
$this->method = "input";
$enctype = $this->showAvatarInput ? " enctype='multipart/form-data'" : "";
$this->html .= openform($this->formname, $this->formname, 'post', $this->formaction, array('enctype' => "" . ($this->showAvatarInput ? 1 : 0) . "", 'downtime' => 0));
// table based for 7. div based for 8.
// do skeleton
if (!$this->registration) {
$title = "General Account Settings";
$Output = $this->renderBasicInputFields();
if (isset($_GET['profiles'])) {
if ($_GET['profiles'] == 'biography') {
$title = "User Information Settings";
$Output = $this->renderFields();
} elseif ($_GET['profiles'] == 'avatar' && $this->showAvatarInput) {
$title = "Avatar Settings";
$Output = $this->renderAvatarInput();
} else {
$title = ucwords($_GET['profiles']) . " Settings";
// this need fix.
$Output = $this->renderFields();
}
}
} else {
$title = $locale['u101'];
$Output = $this->renderBasicInputFields();
$Output .= $this->renderFields();
}
$this->html .= "<div class='row m-b-20'>\n";
if (!$this->registration) {
add_to_title("Edit Profile");
$this->html .= "<div class='col-xs-12 col-sm-3 col-md-2 col-lg-3 p-r-0'>\n";
$this->html .= "<ul id='profile-li'>\n";
$this->html .= "<li " . (!isset($_GET['profiles']) ? "class='active'" : '') . "><a href='" . FUSION_SELF . "'><i class='entypo cog m-r-10'></i>General</a></li>\n";
$this->html .= "<li " . (isset($_GET['profiles']) && $_GET['profiles'] == 'biography' ? "class='active'" : '') . "><a href='" . FUSION_SELF . "?profiles=biography'><i class='entypo lock m-r-10'></i>User Information</a></li>\n";
$this->html .= $this->showAvatarInput ? "<li " . (isset($_GET['profiles']) && $_GET['profiles'] == 'avatar' ? "class='active'" : '') . " style='border-bottom:1px solid #ccc;'><a href='" . FUSION_SELF . "?profiles=avatar'><i class='entypo picture m-r-10'></i>Profile Picture</a></li>\n" : '';
$this->html .= $this->renderPageLink();
$this->html .= "</ul>\n";
$this->html .= "</div>\n";
$this->html .= "<div class='col-xs-12 col-sm-9 col-md-10 col-lg-9' style='border-left:1px solid #ccc;'>\n";
} else {
$this->html .= "<div class='col-xs-12 col-sm-12 col-md-12 col-lg-12'>\n";
}
$this->html .= "<div class='panel panel-default' style='border:0px;'>\n";
$this->html .= "<div class='panel-body'>\n";
$this->html .= "<table cellpadding='0' cellspacing='0' class='table center edit-profile table-responsive'>\n";
$this->html .= $Output;
$this->html .= "</table>\n";
if ($this->displayValidation == 1) {
$this->renderValidation();
}
if ($this->displayTerms == 1) {
$this->renderTerms();
}
$this->renderButton();
$this->html .= "</div></div>\n";
$this->html .= "</div></div>\n";
$this->html .= "</table>\n</form>\n";
$this->js .= "<script type='text/javascript'>\n";
$this->js .= "/*<![CDATA[*/\n";
$this->js .= "\tfunction ValidateForm(frm) {\n";
$this->js .= "\t\tif (\$(frm.user_new_password).val() != \"\") {\n";
$this->js .= "\t\t\tif (\$(frm.user_new_password2).val() != \$(frm.user_new_password).val()) {\n";
$this->js .= "\t\t\t\t\$(frm.user_new_password2).addClass(\"tbl-error\");\n";
$this->js .= "\t\t\t\talert(\"" . $locale['u132'] . $locale['u143'] . "\");\n";
$this->js .= "\t\t\t\treturn false;\n";
$this->js .= "\t\t\t}\n";
$this->js .= "\t\t\t\$(frm.user_new_password2).removeClass(\"tbl-error\");\n";
if ($this->registration == false) {
$this->js .= "\t\t\tif (\$(frm.user_password).val() == \"\") {\n";
$this->js .= "\t\t\t\t\$(frm.user_password).addClass(\"tbl-error\");\n";
$this->js .= "\t\t\t\talert(\"" . $locale['u138'] . "\");\n";
$this->js .= "\t\t\t\treturn false;\n";
$this->js .= "\t\t\t}\n";
}
$this->js .= "\t\t\t\$(frm.user_password).removeClass(\"tbl-error\");\n";
$this->js .= "\t\t\tif (\$(frm.user_new_password).val() == \$(frm.user_password).val()) {\n";
$this->js .= "\t\t\t\t\$(frm.user_new_password).addClass(\"tbl-error\");\n";
$this->js .= "\t\t\t\t\$(frm.user_new_password2).addClass(\"tbl-error\");\n";
$this->js .= "\t\t\t\talert(\"" . $locale['u134'] . $locale['u146'] . $locale['u133'] . "\");\n";
$this->js .= "\t\t\t\treturn false;\n";
$this->js .= "\t\t\t}\n";
$this->js .= "\t\t\t\$(frm.user_new_password).removeClass(\"tbl-error\");\n";
$this->js .= "\t\t\t\$(frm.user_new_password2).removeClass(\"tbl-error\");\n";
$this->js .= "\t\t}\n";
$this->js .= $this->javaScriptRequired;
$this->js .= "\t}\n";
$this->js .= $this->javaScriptOther;
$this->js .= "/*]]>*/\n";
$this->js .= "</script>\n";
add_to_footer($this->js);
add_to_jquery("\r\n \$('#" . $this->postName . "').bind('click', function(e){ ValidateForm('#" . $this->formname . "')});\r\n ");
echo $this->html;
}
示例6: render_admin_panel
function render_admin_panel()
{
global $locale, $userdata, $defender, $pages, $aidlink, $admin;
$languages = fusion_get_enabled_languages();
// Admin panel page
echo "<div id='admin-panel' class='clearfix in'>\n";
// Top header section
echo "<section id='acp-header' class='pull-left affix clearfix' data-offset-top='0' data-offset-bottom='0'>\n";
// Top content sections navigation
echo "<nav>\n";
echo "<ul class='top-left-menu pull-left m-l-15'>\n";
echo "<li><a title='" . $locale['ac00'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=0'>" . $locale['ac00'] . "</a></li>\n";
echo "<li><a title='" . $locale['ac01'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=1'>" . $locale['ac01'] . "</a></li>\n";
echo "<li><a title='" . $locale['ac02'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=2'>" . $locale['ac02'] . "</a></li>\n";
echo "<li><a title='" . $locale['ac03'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=3'>" . $locale['ac03'] . "</a></li>\n";
echo "<li><a title='" . $locale['ac04'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=4'>" . $locale['ac04'] . "</a></li>\n";
echo "<li><a title='" . $locale['ac05'] . "' href='" . ADMIN . "index.php" . $aidlink . "&pagenum=5'>" . $locale['ac05'] . "</a></li>\n";
echo "</ul>\n";
echo "</nav>\n";
// Top navigation
echo "<nav>\n";
// Top right menu links
echo "<ul class='top-right-menu pull-right m-r-15'>\n";
echo "<li class='dropdown'>\n";
echo "<a class='dropdown-toggle pointer' data-toggle='dropdown'>" . display_avatar($userdata, '25px', '', '', '') . " " . $locale['logged'] . "<strong>" . $userdata['user_name'] . "</strong> <span class='caret'></span>\n</a>\n";
echo "<ul class='dropdown-menu' role='menu'>\n";
echo "<li><a class='display-block' href='" . BASEDIR . "edit_profile.php'>" . $locale['edit'] . " " . $locale['profile'] . "</a></li>\n";
echo "<li><a class='display-block' href='" . BASEDIR . "profile.php?lookup=" . $userdata['user_id'] . "'>" . $locale['view'] . " " . $locale['profile'] . "</a></li>\n";
echo "<li class='divider'> </li>\n";
echo "<li><a class='display-block' href='" . FUSION_REQUEST . "&logout'>" . $locale['admin-logout'] . "</a></li>\n";
echo "<li><a class='display-block' href='" . BASEDIR . "index.php?logout=yes'>" . $locale['logout'] . "</a></li>\n";
echo "</ul>\n";
echo "</li>\n";
if (count($languages) > 1) {
echo "<li class='dropdown'><a class='dropdown-toggle pointer' data-toggle='dropdown' title='" . $locale['282'] . "'><i class='fa fa-globe fa-lg fa-fw'></i> " . translate_lang_names(LANGUAGE) . "<span class='caret'></span></a>\n";
echo "<ul class='dropdown-menu'>\n";
foreach ($languages as $language_folder => $language_name) {
echo "<li><a class='display-block' href='" . clean_request("lang=" . $language_folder, array("lang"), FALSE) . "'><img class='m-r-5' src='" . BASEDIR . "locale/{$language_folder}/{$language_folder}-s.png'> {$language_name}</a></li>\n";
}
echo "</ul>\n";
echo "</li>\n";
}
echo "</ul>\n";
// .top-right-menu
echo "</nav>\n";
echo "</section>\n";
// Content section
echo "<div class='content-wrapper display-table pull-left'>\n";
// Main content wrapper
echo "<div id='acp-content' class='m-t-20 col-xs-12 col-sm-12 col-md-12 col-lg-12'>\n";
// Render breadcrumbs
echo render_breadcrumbs();
// Get and render notices
$notices = getNotices();
echo renderNotices($notices);
// Render the content
echo CONTENT;
echo "</div>\n";
// #acp-content
// Footer section
echo "<footer class='m-l-20 display-inline-block m-t-20 m-b-20'>\n";
// Copyright
echo "Old_School Admin © " . date("Y") . " created by <a href='https://www.php-fusion.co.uk'><strong>PHP-Fusion Inc.</strong></a>\n";
echo showcopyright();
// Render time
if (fusion_get_settings('rendertime_enabled')) {
echo "<br /><br />";
// Make showing of queries and memory usage separate settings
echo showrendertime();
echo showMemoryUsage();
}
echo "<hr />\n";
echo showFooterErrors();
echo "</footer>\n";
echo "</div>\n";
// .acp-main
echo "</div>\n";
// #admin-panel
// Wrappers
echo "</div></div></div></div>\n";
add_to_footer("<script src='" . THEMES . "admin_themes/Old_School/includes/jquery.slimscroll.min.js'></script>");
add_to_jquery("\n// Initialize slimscroll\n\$('#adl').slimScroll({\n\theight: null\n});\n");
}
示例7: form_address
function form_address($title = false, $input_name, $input_id, $input_value = false, $array = false)
{
if (isset($title) && $title !== "") {
$title = stripinput($title);
} else {
$title = "";
}
if (isset($input_name) && $input_name !== "") {
$input_name = stripinput($input_name);
} else {
$input_name = "";
}
if (isset($input_id) && $input_id !== "") {
$input_id = stripinput($input_id);
} else {
$input_id = "";
}
$input_id = str_replace(" ", "", $input_id);
$input_id = str_replace("/", "", $input_id);
if (!defined("SELECT2")) {
define("SELECT2", true);
add_to_footer("<script src='" . DYNAMICS . "assets/select2/select2.min.js'></script>");
add_to_head("<link href='" . DYNAMICS . "assets/select2/select2.css' rel='stylesheet' />");
}
require INCLUDES . "geomap/geomap.inc.php";
// NOTE (remember to parse readback value as such):
// $input_value = "Lot 87, Taman Khidmat,|Lorong Pokok Seraya 3A,|North-Korea|Sabah|Kota Kinabalu|89350";
if (isset($input_value) && !empty($input_value)) {
if (!is_array($input_value)) {
$input_value = construct_array($input_value, "", "|");
}
} else {
$input_value['0'] = "";
$input_value['1'] = "";
$input_value['2'] = "";
$input_value['3'] = "";
$input_value['4'] = "";
$input_value['5'] = "";
}
if (!is_array($array)) {
$array = array();
$before = "";
$after = "";
$required = "";
$deactivate = "";
$width = "";
$class = "";
$well = "";
$required = 0;
$safemode = 0;
$stacking = 0;
$helper_text = "";
} else {
$deactivate = array_key_exists('deactivate', $array) ? $array['deactivate'] : "";
$class = array_key_exists('class', $array) ? $array['class'] : "";
$width = array_key_exists('width', $array) ? $array['width'] : "";
$well = array_key_exists('well', $array) ? "style='margin-top:-10px;'" : "";
$required = array_key_exists('required', $array) && $array['required'] == 1 ? 1 : 0;
$safemode = array_key_exists('safemode', $array) && $array['safemode'] == 1 ? 1 : 0;
$stacking = array_key_exists("stacking", $array) ? 1 : "";
$helper_text = array_key_exists("helper", $array) ? $array['helper'] : "";
}
$html = "";
$html .= "<div class='field'/>\n";
$html .= $title ? "<label for='{$input_id}'/><h3>{$title} " . ($required == 1 ? "<span class='required'>*</span>" : '') . "</h3></label>\n" : '';
$html .= "<div class='ui left labeled input'/>\n";
$html .= "<input type='text' name='" . $input_name . "[]' class='form-control input-sm' id='" . $input_id . "-street' value='" . $input_value['0'] . "' placeholder='Street Address 1' " . ($deactivate == "1" && isnum($deactivate) ? "readonly" : "") . " />\n";
$html .= $required ? "<div class='ui corner label'/><i class='icon asterisk'/></i></div>\n" : '';
$html .= "<div id='{$input_id}-help'></div>";
$html .= "</div>\n";
$html .= "</div>\n";
$html .= "<div class='field'>\n";
$html .= "<div class='ui left labeled input'/>\n";
$html .= "<input type='text' name='" . $input_name . "[]' class='form-control input-sm' id='" . $input_id . "-street2' value='" . $input_value['1'] . "' placeholder='Street Address 2' " . ($deactivate == "1" && isnum($deactivate) ? "readonly" : "") . ">";
$html .= "<div id='{$input_id}-help'></div>";
$html .= "</div>\n";
$html .= "</div>\n";
$html .= "<div id='{$input_id}-field' class='three fields'/>\n";
$html .= "<div class='field'>\n";
$html .= "<div class='ui left labeled input'/>\n";
$html .= "<select name='" . $input_name . "[]' id='{$input_id}-country' style='width:100%;'/>\n";
$html .= "<option value=''></option>";
foreach ($countries as $arv => $countryname) {
// outputs: key, value, class - in order
$country_key = str_replace(" ", "-", $countryname);
if ($input_value['2'] == $country_key) {
$select = "selected";
} else {
$select = "";
}
$html .= "<option value='{$country_key}' {$select}>{$countryname}</option>";
}
$html .= "</select>\n";
$html .= "<div id='{$input_id}-help'></div>";
$html .= "</div>\n";
$html .= "</div>\n";
$html .= "<div class='field'>\n";
$html .= "<div class='ui left labeled input'/>\n";
$html .= "<div id='state-spinner' style='display:none;'>\n<img src='" . IMAGES . "loader.gif'>\n</div>\n";
$html .= "<input type='hidden' name='" . $input_name . "[]' id='{$input_id}-state' value='" . $input_value['3'] . "' style='width:100%;' />\n";
//.........这里部分代码省略.........
示例8: jumpforum
$viewthread_js .= "/*<![CDATA[*/";
$viewthread_js .= "jQuery(document).ready(function(){";
if (!empty($highlight_js) || !empty($colorbox_js) || !empty($edit_reason_js)) {
$viewthread_js .= $highlight_js . $colorbox_js . $edit_reason_js;
}
$viewthread_js .= "jQuery('a[href=#top]').click(function(){";
$viewthread_js .= "jQuery('html, body').animate({scrollTop:0}, 'slow');";
$viewthread_js .= "return false;";
$viewthread_js .= "});";
$viewthread_js .= "});";
// below functions could be made more unobtrusive thanks to jQuery, giving a more accessible cms
$viewthread_js .= "function jumpforum(forum_id){";
$viewthread_js .= "document.location.href='" . FORUM . "viewforum.php?forum_id='+forum_id;";
$viewthread_js .= "}";
if (iMOD) {
// only moderators need this javascript
$viewthread_js .= "function setChecked(frmName,chkName,val){";
$viewthread_js .= "dml=document.forms[frmName];";
$viewthread_js .= "len=dml.elements.length;";
$viewthread_js .= "for(i=0;i<len;i++){";
$viewthread_js .= "if(dml.elements[i].name==chkName){";
$viewthread_js .= "dml.elements[i].checked=val;";
$viewthread_js .= "}";
$viewthread_js .= "}";
$viewthread_js .= "}";
}
$viewthread_js .= "/*]]>*/";
$viewthread_js .= "</script>";
add_to_footer($viewthread_js);
//unset($viewthread_js);
require_once THEMES . "templates/footer.php";
示例9: render_news_item
/**
* News Item Page Template
* @param $info
*/
function render_news_item($info)
{
global $aidlink;
$locale = fusion_get_locale();
$news_settings = get_settings('news');
$data = $info['news_item'];
add_to_head("<link rel='stylesheet' href='" . INFUSIONS . "news/templates/css/news.css' type='text/css'>");
add_to_head("<link rel='stylesheet' href='" . INCLUDES . "jquery/colorbox/colorbox.css' type='text/css' media='screen' />");
add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/colorbox/jquery.colorbox.js'></script>");
add_to_footer('<script type="text/javascript">
$(document).ready(function() {
$(".news-image-overlay").colorbox({
transition: "elasic",
height:"100%",
width:"100%",
maxWidth:"98%",
maxHeight:"98%",
scrolling:false,
overlayClose:true,
close:false,
photo:true,
onComplete: function(result) {
$("#colorbox").live("click", function(){
$(this).unbind("click");
$.fn.colorbox.close();
});
},
onLoad: function () {
}
});
});
</script>');
opentable($locale['news_0004']);
echo render_breadcrumbs();
echo "<!--news_pre_readmore-->";
echo "<article class='news-item' style='display:block; width:100%; overflow:hidden;'>\n";
echo "<h2 class='text-center'>" . $data['news_subject'] . "</h2>\n";
echo "<div class='news_news text-dark m-t-20 m-b-20'>\n";
if ($data['news_image_src']) {
echo "<a class='" . $data['news_ialign'] . " news-image-overlay' href='" . $data['news_image_src'] . "'>\n <img class='img-responsive' src='" . $data['news_image_src'] . "' alt='" . $data['news_subject'] . "' style='padding:5px; max-height:" . $news_settings['news_photo_h'] . "px; overflow:hidden;' /></a>";
} elseif (!empty($data['news_image']) && !empty($data['news_cat_image_src'])) {
echo "<a class='" . $data['news_ialign'] . "' href='" . INFUSIONS . "news/news.php?cat_id=" . $data['news_cat_id'] . "'>\n <img class='img-responsive' src='" . IMAGES_NC . $data['news_cat_image_src'] . "' style='padding:5px; max-height:" . $news_settings['news_photo_h'] . "px; alt='" . $data['news_cat_name'] . "' />\n </a>";
}
echo $data['news_news'];
echo "</div>\n";
echo "<div class='news_extended text-dark m-t-20 m-b-20'>" . $data['news_extended'] . "</div>\n";
echo "<div style='clear:both;'></div>\n";
echo "<div class='well m-t-5 text-center'>\n";
echo "<span class='news-action m-r-10'><i class='fa fa-user'></i>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "</span>\n";
echo "<span class='news-action m-r-10'><i class='fa fa-calendar'></i>" . showdate("newsdate", $data['news_datestamp']) . "</span>\n";
echo "<span class='news-action'><i class='fa fa-eye'></i><span class='text-dark m-r-10'>" . number_format($data['news_reads']) . "</span>\n</span>";
echo $data['news_allow_comments'] ? display_comments($data['news_comments'], INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "#comments") : '';
echo $data['news_allow_ratings'] ? "<span class='m-r-10'>" . display_ratings($data['news_sum_rating'], $data['news_count_votes'], INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "#ratings") . " </span>" : '';
echo "<a class='m-r-10' title='" . $locale['news_0002'] . "' href='" . BASEDIR . "print.php?type=N&item_id=" . $data['news_id'] . "'><i class='fa fa-print'></i></a>";
echo iADMIN && checkrights("N") ? "<a title='" . $locale['news_0003'] . "' href='" . INFUSIONS . "news/news_admin.php" . $aidlink . "&action=edit&section=news_form&news_id=" . $data['news_id'] . "' title='" . $locale['news_0003'] . "' />" . $locale['news_0003'] . "</a>\n" : "";
echo "</div>";
echo "<!--news_sub_readmore-->";
echo !isset($_GET['readmore']) && $data['news_ext'] == "y" ? "<div class='m-t-20'>\n<a href='" . INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "' class='button'>" . $locale['news_0001'] . "</a>\n</div>\n" : "";
if ($data['page_count'] > 0) {
echo "<div class='text-center m-t-10'>\n" . makepagenav($_GET['rowstart'], 1, $data['page_count'], 3, INFUSIONS . "news/news.php?readmore=" . $_GET['readmore'] . "&") . "\n</div>\n";
}
if ($data['news_allow_comments']) {
echo "<hr />" . showcomments("N", DB_NEWS, "news_id", $_GET['readmore'], INFUSIONS . "news/news.php?readmore=" . $_GET['readmore']) . "\n";
}
if ($data['news_allow_ratings']) {
echo "<hr />" . showratings("N", $_GET['readmore'], INFUSIONS . "news/news.php?readmore=" . $_GET['readmore']) . "\n";
}
echo "</article>\n";
closetable();
}
示例10: foreach
foreach ($swords as $hlight) {
$higlight .= "'" . $hlight . "'";
$higlight .= $i < $c_swords ? "," : "";
$i++;
}
add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/jquery.highlight.js'></script>");
$highlight_js = "<script type='text/javascript'>";
$highlight_js .= "/*<![CDATA[*/";
$highlight_js .= "jQuery(document).ready(function(){";
$highlight_js .= "jQuery('.search_result').highlight([" . $higlight . "],{wordsOnly:true});";
$highlight_js .= "jQuery('.highlight').css({backgroundColor:'#FFFF88'});";
//better via theme or settings
$highlight_js .= "});";
$highlight_js .= "/*]]>*/";
$highlight_js .= "</script>";
add_to_footer($highlight_js);
if ($_GET['stype'] == "all") {
$dh = opendir(INCLUDES . "search");
while (FALSE !== ($entry = readdir($dh))) {
if ($entry != "." && $entry != ".." && preg_match("/include.php/i", $entry)) {
include INCLUDES . "search/" . $entry;
}
}
closedir($dh);
} else {
include INCLUDES . "search/search_" . $_GET['stype'] . "_include.php";
}
$c_iwords = count($iwords);
if ($c_iwords) {
$txt = "";
for ($i = 0; $i < $c_iwords; $i++) {
示例11: define
<?php
/* Updated 2014/July - https://github.com/sciactive/pnotify */
require_once __DIR__ . '/../output_handling_include.php';
if (!defined('NOTIFICATION_UI')) {
define('NOTIFICATION_UI', TRUE);
add_to_footer("<script type='text/javascript' src='" . INCLUDES . "notify/pnotify.js'></script>\n");
}
/**
* Pop up notification
* @param $title
* @param $text
* @param array $options
*/
function notify($title, $text, array $options = array())
{
// init library
$default_options = array("sticky" => TRUE, "animation" => 1, "icon" => "notify_icon n-attention");
$options += $default_options;
$sticky = $options['sticky'] == TRUE ? "hide:false," : "";
switch ($options['animation']) {
case 1:
$animation = "animation: 'show',";
break;
case 2:
$animation = "animation: 'fade',";
break;
case 3:
$animation = "animation: 'slide',";
break;
default:
示例12: form_datepicker
/**
* Input to save date using datepicker
* Datetimepicker documentation - http://eonasdan.github.io/bootstrap-datetimepicker/Options/
*
* @param $input_name
* @param string $label
* @param string $input_value
* @param array $options
* <ul>
* <li><strong>class</strong> (string): Empty string by default.
* The value of attribute class of the input.</li>
* <li><strong>date_format</strong> (string): dd-mm-yyyy by default.
* Date format for datepicker plugin.</li>
* <li><strong>deactivate</strong> (boolean): FALSE by default.
* You can pass TRUE and turn off the javascript datepicker plugin</li>
* <li><strong>error_text</strong> (string): empty string by default.
* An error message</li>
* <li><strong>fieldicon_off</strong> (boolean): FALSE by default.
* If TRUE, the calendar icon will be not displayed in the input.</li>
* <li><strong>inline</strong> (boolean): FALSE by default.
* TRUE if the input should be an inline element.</li>
* <li><strong>input_id</strong> (string): $input name by default.
* The value of attribute id of input.</li>
* <li><strong>required</strong> (boolean): FALSE by default</li>
* <li><strong>type</strong> (string): timestamp by default.
* Valid types:
* <ul>
* <li>date: The date will be saved as mysql date.</li>
* <li>timestamp: A timestamp will be saved as an integer</li>
* </ul>
* </li>
* <li><strong>week_start</strong> (int): 0 by default.
* An integer between 0 and 6. It is the same as
* the attribute weekStart of datepicker.</li>
* <li><strong>width</strong> (string): 250px by default.
* A valid value for CSS width</li>
* </ul>
*
* Callback Usages !important
* ==========================
* Configuration when type is 'timestamp'
* Token used for $options['date_format_php'] is the <a href="http://php.net/manual/en/function.date.php">PHP token equivalent.</a>
* Token used for $options['date_format_js'] must be formatted with <a href="http://momentjs.com/docs/#/displaying/">moment.js.</a>
* Both token must match each other to parse the callback properly.
*
* Currently, only user birthdate in `entire project` uses date format.
*
* Joining 2 datepickers (Start and End)
* =======================================
* In Start Datepicker, add $options['join_to_id'] with End Datepicker's input_id
* In End Datepicker, add $options['join_from_id'] with Start Datepicker's input_id
*
* @return string
*/
function form_datepicker($input_name, $label = '', $input_value = '', array $options = array())
{
global $defender, $locale;
if (!defined('DATEPICKER')) {
define('DATEPICKER', TRUE);
add_to_head("<link href='" . DYNAMICS . "assets/datepicker/css/datetimepicker.min.css' rel='stylesheet' />");
add_to_footer("<script src='" . DYNAMICS . "assets/datepicker/js/moment.min.js'></script>");
add_to_footer("<script src='" . DYNAMICS . "assets/datepicker/js/datetimepicker.min.js'></script>");
add_to_head("<script src='" . DYNAMICS . "assets/datepicker/locale/." . $locale['datepicker'] . ".js'></script>");
}
$title = $label ? stripinput($label) : ucfirst(strtolower(str_replace("_", " ", $input_name)));
$input_name = stripinput($input_name);
$default_options = array('input_id' => $input_name, 'required' => FALSE, 'placeholder' => '', 'deactivate' => FALSE, 'width' => '280px', 'class' => '', 'inline' => FALSE, 'error_text' => $locale['error_input_default'], "date_format_js" => "YYYY-M-DD, H:mm:ss", "date_format_php" => "Y-m-d H:i:s", "delimiter" => "-", 'fieldicon_off' => FALSE, "filtered_dates" => array(), "include_filtered_dates" => (bool) FALSE, "weekend" => array(), "disable_weekend" => (bool) FALSE, 'type' => "timestamp", "tip" => "", "showTime" => (bool) FALSE, 'week_start' => fusion_get_settings('week_start'), "join_to_id" => "", "join_from_id" => "");
$options += $default_options;
if (!empty($input_value)) {
if ($options['type'] == "timestamp") {
$input_value = date($options['date_format_php'], $input_value);
} elseif ($options['type'] == "date") {
if (stristr($input_value, $options['delimiter'])) {
$input_value = explode($options['delimiter'], $input_value);
if (count($input_value) == 3) {
$params = array("year" => $input_value[0], "month" => $input_value[1], "day" => $input_value[2]);
if (checkdate($params['month'], $params['day'], $params['year'])) {
$input_value = implode("-", $params) . " 00:00:00";
} else {
addNotice("warning", "Please ensure your date input value is formatted in date('Y-m-d', callback_data))");
}
} else {
addNotice("warning", "Please ensure your date format has only year, month and day");
}
}
}
} else {
$input_value = "";
}
if (!$options['width']) {
$options['width'] = $default_options['width'];
}
// Format disabled or enabled dates as JS array
$dateFilter = array();
if (!empty($options['filtered_dates']) && is_array($options['filtered_dates'])) {
$date_filtered = "";
$dateFilter[0] = "disabledDates: ";
if ($options['include_filtered_dates'] == TRUE) {
$dateFilter[0] = "enabledDates: ";
}
//.........这里部分代码省略.........
示例13: author
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../maincore.php";
if (!checkrights("P") || !defined("iAUTH") || !isset($_GET['aid']) || $_GET['aid'] != iAUTH) {
redirect("../index.php");
}
require_once THEMES . "templates/admin_header.php";
include LOCALE . LOCALESET . "admin/panels.php";
add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/jquery-ui.js'></script>");
add_to_head("<link rel='stylesheet' href='" . THEMES . "templates/panels.css' type='text/css' media='all' />");
add_to_footer("<script type='text/javascript'>\n\$(document).ready(function() {\n\t\$('.pdisabled').fadeTo(0, .5);\n\t\$('.panels-list').sortable({\n\t\thandle : '.handle',\n\t\tplaceholder: 'state-highlight',\n\t\tconnectWith: '.connected',\n\t\tscroll: true,\n\t\taxis: 'y',\n\t\tupdate: function () {\n\t\t\tvar ul = \$(this),\n\t\t\t\torder = ul.sortable('serialize'),\n\t\t\t\ti = 0;\n\t\t\t\$('#info').load('panels_updater.php" . $aidlink . "&'+order);\n\t\t\tul.find('.num').each(function(i) {\n\t\t\t\t\$(this).text(i+1);\n\t\t\t});\n\t\t\tul.find('li').removeClass('tbl2').removeClass('tbl1');\n\t\t\tul.find('li:odd').addClass('tbl2');\n\t\t\tul.find('li:even').addClass('tbl1');\n\t\t\twindow.setTimeout('closeDiv();',2500);\n\t\t},\n\t\treceive: function () {\n\t\t\tvar ul = \$(this),\n\t\t\t\torder = ul.sortable('serialize'),\n\t\t\t\tpdata = ul.attr('data-side');\n\t\t\t\tif (pdata == 1) { var psidetext = '" . $locale['420'] . "'; }\n\t\t\t\tif (pdata == 2) { var psidetext = '" . $locale['421'] . "'; }\n\t\t\t\tif (pdata == 3) { var psidetext = '" . $locale['425'] . "'; }\n\t\t\t\tif (pdata == 4) { var psidetext = '" . $locale['422'] . "'; }\n\t\t\tul.find('.pside').each(function() {\n\t\t\t\t\$(this).text(psidetext);\n\t\t\t});\n\t\t\t\$('#info').load('panels_updater.php" . $aidlink . "&panel_side='+pdata+'&'+order);\n\t\t}\n\t});\n});\n</script>");
if (isset($_GET['action']) && $_GET['action'] == "delete" && (isset($_GET['panel_id']) && isnum($_GET['panel_id']))) {
$data = dbarray(dbquery("SELECT panel_side, panel_order FROM " . DB_PANELS . " WHERE panel_id='" . $_GET['panel_id'] . "'"));
$result = dbquery("DELETE FROM " . DB_PANELS . " WHERE panel_id='" . $_GET['panel_id'] . "'");
$result = dbquery("UPDATE " . DB_PANELS . " SET panel_order=panel_order-1 WHERE panel_side='" . $data['panel_side'] . "' AND panel_order>='" . $data['panel_order'] . "'");
redirect(FUSION_SELF . $aidlink);
}
if (isset($_GET['action']) && $_GET['action'] == "setstatus" && (isset($_GET['panel_id']) && isnum($_GET['panel_id']))) {
$result = dbquery("UPDATE " . DB_PANELS . " SET panel_status='" . intval($_GET['status']) . "' WHERE panel_id='" . $_GET['panel_id'] . "'");
}
opentable($locale['400']);
echo "<div id='info'></div>\n";
$side = array("1" => $locale['420'], "2" => $locale['421'], "3" => $locale['425'], "4" => $locale['422']);
$panels = array("1" => array(), "2" => array(), "3" => array(), "4" => array());
$result = dbquery("SELECT panel_id, panel_name, panel_side, panel_order, panel_type, panel_access, panel_status\n\tFROM " . DB_PANELS . "\n\tORDER BY panel_side,panel_order");
while ($data = dbarray($result)) {
示例14: showFooterErrors
/** Use this function to show error logs */
public function showFooterErrors()
{
$locale = self::$locale;
$aidlink = fusion_get_aidlink();
$html = "";
if (iADMIN && checkrights("ERRO") && (count($this->errors) || count($this->new_errors)) && !defined("NO_DEBUGGER")) {
$html = "<i class='fa fa-bug fa-lg'></i></button><strong>\n";
$html .= str_replace(array("[ERROR_LOG_URL]", "[/ERROR_LOG_URL]"), array("<a id='footer_debug' href='" . ADMIN . "errors.php" . $aidlink . "'>", "</a>"), $locale['err_101']);
$html .= "</strong><span class='badge m-l-10'>L: " . count($this->errors) . "</span>\n";
$html .= "<span class='badge m-l-10'>N: " . count($this->new_errors) . "</span>\n";
$cHtml = openmodal('tbody', 'Error Console', array('class' => 'modal-lg modal-center zindex-boost', 'button_id' => 'footer_debug'));
$cHtml .= $this->getErrorLogs();
$cHtml .= closemodal();
add_to_footer($cHtml);
}
return $html;
}
示例15: validateNews
$submit_js .= "}";
/************ news ******/
$submit_js .= "function validateNews(frm){";
$submit_js .= 'if(frm.news_subject.value=="" || frm.news_body.value==""){';
$submit_js .= 'alert("' . $locale['550'] . '"); return false;';
$submit_js .= "}";
$submit_js .= "}";
/************ articles **/
$submit_js .= "function validateArticle(frm){";
$submit_js .= 'if(frm.article_subject.value=="" || frm.article_snippet.value=="" || frm.article_body.value==""){';
$submit_js .= 'alert("' . $locale['550'] . '"); return false;';
$submit_js .= "}";
$submit_js .= "}";
/************ photos ****/
$submit_js .= "function validatePhoto(frm){";
$submit_js .= 'if(frm.photo_title.value=="" || frm.photo_description.value=="" || frm.photo_pic_file.value==""){';
$submit_js .= 'alert("' . $locale['550'] . '"); return false;';
$submit_js .= "}";
$submit_js .= "}";
/************ downloads */
$submit_js .= "function validateDownload(frm){";
$submit_js .= 'if(frm.download_title.value=="" || frm.download_description_short.value=="" || (frm.download_url.value=="" && frm.download_file.value=="")){';
$submit_js .= 'alert("' . $locale['550'] . '"); return false;';
$submit_js .= "}";
$submit_js .= "}";
/************ -- end -- */
$submit_js .= "/*]]>*/";
$submit_js .= "</script>";
add_to_footer($submit_js);
unset($submit_js);
require_once THEMES . "templates/footer.php";