- md5
- 3b02c62b04c1c2716af7416de3547cb4
- sha1
- 8a9a54910215ee2c3d08ee13cd5b44be47488245
- sha256
- 61b76650132d449f0de4f531d338dacb8663a9e1509e26bce64aab709f501f3f
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
<?php
/**
* @version $Id: admin.syndicate.php 3714 2006-05-29 03:55:59Z stingrey $
* @package Joomla
* @subpackage Syndicate
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );
// ensure user has access to this function
if (!($acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'all' ) | $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'com_contact' ))) {
mosRedirect( 'index2.php', _NOT_AUTH );
}
require_once( $mainframe->getPath( 'admin_html' ) );
switch ($task) {
case 'save':
saveSyndicate( $option );
break;
case 'cancel':
cancelSyndicate( );
break;
default:
showSyndicate( $option );
break;
}
/**
* List the records
* @param string The current GET/POST option
*/
function showSyndicate( $option ) {
global $database, $mainframe;
$query = "SELECT a.id"
. "\n FROM #__components AS a"
. "\n WHERE ( a.admin_menu_link = 'option=com_syndicate' OR a.admin_menu_link = 'option=com_syndicate&hidemainmenu=1' )"
. "\n AND a.option = 'com_syndicate'"
;
$database->setQuery( $query );
$id = $database->loadResult();
// load the row from the db table
$row = new mosComponent( $database );
$row->load( $id );
// get params definitions
$params = new mosParameters( $row->params, $mainframe->getPath( 'com_xml', $row->option ), 'component' );
HTML_syndicate::settings( $option, $params, $id );
}
/**
* Saves the record from an edit form submit
* @param string The current GET/POST option
*/
function saveSyndicate( $option ) {
global $database;
$params = mosGetParam( $_POST, 'params', '' );
if (is_array( $params )) {
$txt = array();
foreach ($params as $k=>$v) {
$txt[] = "$k=$v";
}
$_POST['params'] = mosParameters::textareaHandling( $txt );
}
$id = intval( mosGetParam( $_POST, 'id', '17' ) );
$row = new mosComponent( $database );
$row->load( $id );
if (!$row->bind( $_POST )) {
echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
exit();
}
if (!$row->check()) {
echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
exit();
}
if (!$row->store()) {
echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
exit();
}
$msg = 'Settings successfully Saved';
mosRedirect( 'index2.php?option='. $option, $msg );
}
/**
* Cancels editing and checks in the record
*/
function cancelSyndicate(){
mosRedirect( 'index2.php' );
}
?>
No other release has this exact content. See every version of this file.