2012-06-04 16:58:40 +02:00
|
|
|
<?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>
|
2016-03-26 19:22:15 +01:00
|
|
|
Portions created by the Initial Developer are Copyright (C) 2008-2016
|
2012-06-04 16:58:40 +02:00
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
*/
|
2019-09-04 19:20:27 +02:00
|
|
|
|
|
|
|
|
//includes
|
|
|
|
|
include "root.php";
|
|
|
|
|
require_once "resources/require.php";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-25 23:30:35 +01:00
|
|
|
//set the template base directory path
|
|
|
|
|
$template_base_path = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/themes';
|
|
|
|
|
|
|
|
|
|
//check if the template exists if it is missing then use the default
|
|
|
|
|
if (!file_exists($template_base_path.'/'.$_SESSION['domain']['template']['name'].'/template.php')) {
|
|
|
|
|
$_SESSION['domain']['template']['name'] = 'default';
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//start the output buffer
|
2016-03-25 23:30:35 +01:00
|
|
|
include $template_base_path.'/'.$_SESSION['domain']['template']['name'].'/config.php';
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//start the output buffer
|
|
|
|
|
ob_start();
|
|
|
|
|
|
|
|
|
|
// get the content
|
2012-08-09 07:34:01 +02:00
|
|
|
if (isset($_GET["c"])) {
|
2012-06-04 16:58:40 +02:00
|
|
|
$content = $_GET["c"]; //link
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$content = '';
|
|
|
|
|
}
|
2012-10-11 03:04:47 +02:00
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//get the parent id
|
2019-08-29 01:53:34 +02:00
|
|
|
$sql = "select menu_item_parent_uuid from v_menu_items ";
|
|
|
|
|
$sql .= "where menu_uuid = :menu_uuid ";
|
|
|
|
|
$sql .= "and menu_item_link = :menu_item_link ";
|
|
|
|
|
$parameters['menu_uuid'] = $_SESSION['domain']['menu']['uuid'];
|
|
|
|
|
$parameters['menu_item_link'] = $_SERVER["SCRIPT_NAME"];
|
|
|
|
|
$database = new database;
|
2019-09-04 19:11:04 +02:00
|
|
|
$_SESSION["menu_item_parent_uuid"] = $database->select($sql, $parameters, 'column');
|
|
|
|
|
unset($sql, $parameters);
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//get the content
|
2016-01-17 08:01:13 +01:00
|
|
|
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/content/app_config.php")) {
|
2013-09-15 07:02:00 +02:00
|
|
|
$sql = "select * from v_rss ";
|
2019-08-29 01:53:34 +02:00
|
|
|
$sql .= "where domain_uuid = :domain_uuid ";
|
2013-09-15 07:02:00 +02:00
|
|
|
$sql .= "and rss_category = 'content' ";
|
2019-08-29 01:53:34 +02:00
|
|
|
$sql .= "and rss_link = :content ";
|
|
|
|
|
$sql .= "and ( ";
|
|
|
|
|
$sql .= "length(rss_del_date) = 0 ";
|
|
|
|
|
$sql .= "or rss_del_date is null ";
|
|
|
|
|
$sql .= ") ";
|
2013-09-15 07:02:00 +02:00
|
|
|
$sql .= "order by rss_order asc ";
|
2019-08-29 01:53:34 +02:00
|
|
|
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
|
|
|
|
$parameters['content'] = strlen($content) == 0 ? $_SERVER["PHP_SELF"] : $content;
|
|
|
|
|
$database = new database;
|
|
|
|
|
$content_result = $database->select($sql, $parameters, 'all');
|
|
|
|
|
if (is_array($content_result) && @sizeof($content_result) != 0) {
|
|
|
|
|
foreach($content_result as $content_row) {
|
|
|
|
|
$template_rss_sub_category = $content_row['rss_sub_category'];
|
|
|
|
|
if (strlen($content_row['rss_group']) == 0) {
|
|
|
|
|
//content is public
|
|
|
|
|
$content_from_db = &$content_row['rss_description'];
|
2013-09-15 07:02:00 +02:00
|
|
|
if (strlen($content_row['rss_title']) > 0) {
|
|
|
|
|
$page["title"] = $content_row['rss_title'];
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-08-29 01:53:34 +02:00
|
|
|
else {
|
|
|
|
|
if (if_group($content_row[rss_group])) { //viewable only to designated group
|
|
|
|
|
$content_from_db = &$content_row[rss_description];
|
|
|
|
|
if (strlen($content_row['rss_title']) > 0) {
|
|
|
|
|
$page["title"] = $content_row['rss_title'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-09-15 07:02:00 +02:00
|
|
|
}
|
2019-08-29 01:53:34 +02:00
|
|
|
}
|
|
|
|
|
unset($sql, $parameters, $content_result, $content_row);
|
2013-09-15 07:02:00 +02:00
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//start the output buffer
|
|
|
|
|
ob_start();
|
|
|
|
|
|
2015-01-18 08:54:19 +01:00
|
|
|
//for translate tool (if available)
|
|
|
|
|
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/translate")) {
|
|
|
|
|
require_once("app/translate/translate_header.php");
|
|
|
|
|
}
|
2016-03-25 23:30:35 +01:00
|
|
|
|
2019-09-04 19:11:04 +02:00
|
|
|
?>
|