Source for file content_blog_section.class.php
Documentation is available at content_blog_section.class.php
* @copyright Refer to copyright.php
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @author Mambo Foundation Inc see README.php
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
* @param database A database connector object
* @param integer The unique id of the section to edit (0 if new)
function edit( $uid, $menutype, $option ) {
global $database, $my, $mainframe;
global $mosConfig_absolute_path;
// fail if checked out not by 'me'
if ($menu->checked_out &&
$menu->checked_out <>
$my->id) {
echo
"<script>alert('".
sprintf(T_('The module % is currently being edited by another administrator'), $menu->title).
"'); document.location.href='index2.php?option=$option'</script>\n";
$menu->checkout( $my->id );
// get previously selected Categories
$secids =
$params->def( 'sectionid', '' );
$query =
"SELECT s.id AS `value`, s.id AS `id`, s.title AS `text`"
.
"\n FROM #__sections AS s"
.
"\n WHERE s.scope = 'content'"
.
"\n AND s.id IN ( ".
$secids .
")"
$database->setQuery( $query );
$lookup =
$database->loadObjectList();
$menu->type =
'content_blog_section';
$menu->menutype =
$menutype;
// build the html select list for section
$query =
"SELECT s.id AS `value`, s.id AS `id`, s.title AS `text`"
.
"\n FROM #__sections AS s"
.
"\n WHERE s.scope = 'content'"
$database->setQuery( $query );
$rows =
array_merge( $rows, $database->loadObjectList() );
$section =
mosHTML::selectList( $rows, 'secid[]', 'class="inputbox" size="10" multiple="multiple"', 'value', 'text', $lookup );
$lists['sectionid'] =
$section;
// build the html select list for ordering
// build the html select list for the group access
// build the html select list for paraent item
// build published button option
// build the url link output
// get params definitions
$params =
& new mosAdminParameters( $menu->params, $mainframe->getPath( 'menu_xml', $menu->type ), 'menu' );
$params[sectionid] =
$secid;
foreach ($params as $k=>
$v) {
if (!$row->bind( $_POST )) {
echo
"<script> alert('".
$row->getError().
"'); window.history.go(-1); </script>\n";
if ( count( $secids )==
1 &&
$secids[0] !=
'' ) {
$row->link =
str_replace( 'id=0','id='.
$secids[0], $row->link );
$row->componentid =
$secids[0];
echo
"<script> alert('".
$row->getError().
"'); window.history.go(-1); </script>\n";
echo
"<script> alert('".
$row->getError().
"'); window.history.go(-1); </script>\n";
$row->updateOrder( "menutype='$row->menutype' AND parent='$row->parent'" );
$msg =
'Menu item Saved';
mosRedirect( 'index2.php?option='.
$option .
'&menutype='.
$row->menutype .
'&task=edit&id='.
$row->id, $msg );
mosRedirect( 'index2.php?option='.
$option .
'&menutype='.
$row->menutype, $msg );
Documentation generated on Mon, 05 May 2008 16:18:40 +0400 by phpDocumentor 1.4.0