mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Move header.php and footer.php files to the resources directory.
This commit is contained in:
@@ -1,100 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//get the output from the buffer
|
||||
$body = $content_from_db.ob_get_contents();
|
||||
ob_end_clean(); //clean the buffer
|
||||
|
||||
//set a default template
|
||||
if (strlen($_SESSION['domain']['template']['name']) == 0) { $_SESSION['domain']['template']['name'] = 'default'; }
|
||||
|
||||
//set a default template
|
||||
if (strlen($_SESSION["template_content"])==0) { //build template if session template has no length
|
||||
$v_template_path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes';
|
||||
if (strlen($template_rss_sub_category) > 0) {
|
||||
//this template was assigned by the content manager
|
||||
//get the contents of the template and save it to the template variable
|
||||
$template_full_path = $v_template_path.'/'.$template_rss_sub_category.'/template.php';
|
||||
if (!file_exists($template_full_path)) {
|
||||
$_SESSION['domain']['template']['name'] = 'default';
|
||||
$template_full_path = $v_template_path.'/default/template.php';
|
||||
}
|
||||
$template = file_get_contents($template_full_path);
|
||||
$_SESSION["template_content"] = $template;
|
||||
}
|
||||
else {
|
||||
//get the contents of the template and save it to the template variable
|
||||
$template_full_path = $v_template_path.'/'.$_SESSION['domain']['template']['name'].'/template.php';
|
||||
if (!file_exists($template_full_path)) {
|
||||
$_SESSION['domain']['template']['name'] = 'default';
|
||||
$template_full_path = $v_template_path.'/default/template.php';
|
||||
}
|
||||
$template = file_get_contents($template_full_path);
|
||||
$_SESSION["template_content"] = $template;
|
||||
}
|
||||
}
|
||||
|
||||
//start the output buffer
|
||||
ob_start();
|
||||
$template = $_SESSION["template_content"];
|
||||
eval('?>' . $template . '<?php ');
|
||||
$template = ob_get_contents(); //get the output from the buffer
|
||||
ob_end_clean(); //clean the buffer
|
||||
|
||||
//get the menu
|
||||
require_once "resources/menu.php";
|
||||
|
||||
//prepare the template to display the output
|
||||
$custom_head = '';
|
||||
$output = str_replace ("<!--{title}-->", $page["title"], $template); //<!--{title}--> defined in each individual page
|
||||
$output = str_replace ("<!--{head}-->", $custom_head, $output); //<!--{head}--> defined in each individual page
|
||||
if (strlen($v_menu) > 0) {
|
||||
$output = str_replace ("<!--{menu}-->", $v_menu, $output); //defined in /resources/menu.php
|
||||
}
|
||||
else {
|
||||
$output = str_replace ("<!--{menu}-->", $_SESSION["menu"], $output); //defined in /resources/menu.php
|
||||
}
|
||||
$output = str_replace ("<!--{project_path}-->", PROJECT_PATH, $output); //defined in /resources/menu.php
|
||||
|
||||
$pos = strrpos($output, "<!--{body}-->");
|
||||
if ($pos === false) {
|
||||
$output = $body; //if tag not found just show the body
|
||||
}
|
||||
else {
|
||||
//replace the body
|
||||
$output = str_replace ("<!--{body}-->", $body, $output);
|
||||
}
|
||||
|
||||
//send the output to the browser
|
||||
echo $output;
|
||||
unset($output);
|
||||
|
||||
//$statsauth = "a3az349x2bf3fdfa8dbt7x34fas5X";
|
||||
//require_once "stats/stat_sadd.php";
|
||||
|
||||
?>
|
||||
@@ -1,131 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
|
||||
//if reloadxml then run the command
|
||||
if (isset($_SESSION["reload_xml"])) {
|
||||
if (strlen($_SESSION["reload_xml"]) > 0) {
|
||||
if ($_SESSION['apply_settings'] == "true") {
|
||||
//show the apply settings prompt
|
||||
}
|
||||
else {
|
||||
//create the event socket connection
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
//reload the access control list this also runs reloadxml
|
||||
$response = event_socket_request($fp, 'api reloadxml');
|
||||
$_SESSION["reload_xml"] = '';
|
||||
unset($_SESSION["reload_xml"]);
|
||||
usleep(500);
|
||||
//clear the apply settings reminder
|
||||
$_SESSION["reload_xml"] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//set a default template
|
||||
if (!isset($_SESSION['domain']['template']['name'])) { $_SESSION['domain']['template']['name'] = 'default'; }
|
||||
|
||||
//set a default template
|
||||
$v_template_path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes';
|
||||
if (!isset($_SESSION['domain']['template']['name'])) {
|
||||
//get the contents of the template and save it to the template variable
|
||||
$template_full_path = $v_template_path.'/'.$_SESSION['domain']['template']['name'].'/template.php';
|
||||
if (!file_exists($template_full_path)) {
|
||||
$_SESSION['domain']['template']['name'] = 'default';
|
||||
}
|
||||
}
|
||||
|
||||
//start the output buffer
|
||||
include $v_template_path.'/'.$_SESSION['domain']['template']['name'].'/config.php';
|
||||
|
||||
//start the output buffer
|
||||
ob_start();
|
||||
|
||||
// get the content
|
||||
if (isset($_GET["c"])) {
|
||||
$content = $_GET["c"]; //link
|
||||
}
|
||||
else {
|
||||
$content = '';
|
||||
}
|
||||
|
||||
//get the parent id
|
||||
$sql = "select * from v_menu_items ";
|
||||
$sql .= "where menu_uuid = '".$_SESSION['domain']['menu']['uuid']."' ";
|
||||
$sql .= "and menu_item_link = '".$_SERVER["SCRIPT_NAME"]."' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$_SESSION["menu_item_parent_uuid"] = $row["menu_item_parent_uuid"];
|
||||
break;
|
||||
}
|
||||
unset($result);
|
||||
|
||||
//get the content
|
||||
$sql = "select * from v_rss ";
|
||||
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
||||
$sql .= "and rss_category = 'content' ";
|
||||
if (strlen($content) == 0) {
|
||||
$sql .= "and rss_link = '".$_SERVER["PHP_SELF"]."' ";
|
||||
}
|
||||
else {
|
||||
$sql .= "and rss_link = '".$content."' ";
|
||||
}
|
||||
$sql .= "and (length(rss_del_date) = 0 ";
|
||||
$sql .= "or rss_del_date is null) ";
|
||||
$sql .= "order by rss_order asc ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$result_count = count($result);
|
||||
|
||||
$page["title"] = '';
|
||||
foreach($result as $row) {
|
||||
$template_rss_sub_category = $row['rss_sub_category'];
|
||||
if (strlen($row['rss_group']) == 0) {
|
||||
//content is public
|
||||
$content_from_db = &$row['rss_description'];
|
||||
if (strlen($row['rss_title']) > 0) {
|
||||
$page["title"] = $row['rss_title'];
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (if_group($row[rss_group])) { //viewable only to designated group
|
||||
$content_from_db = &$row[rss_description];
|
||||
if (strlen($row['rss_title']) > 0) {
|
||||
$page["title"] = $row['rss_title'];
|
||||
}
|
||||
}
|
||||
}
|
||||
} //end foreach
|
||||
unset($sql, $result, $row_count);
|
||||
|
||||
//start the output buffer
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user