Source for file content_item_link.class.php
Documentation is available at content_item_link.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.' );
* Content item link class
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 );
// load values for new entry
$menu->type =
'content_item_link';
$menu->menutype =
$menutype;
$link =
'javascript:submitbutton( \'redirect\' );';
$temp =
explode( 'id=', $menu->link );
$query =
"SELECT a.title, c.name AS category, s.name AS section"
.
"\n FROM #__content AS a"
.
"\n LEFT JOIN #__categories AS c ON a.catid = c.id"
.
"\n LEFT JOIN #__sections AS s ON a.sectionid = s.id"
.
"\n WHERE a.id = '".
$temp[1] .
"'"
$database->setQuery( $query );
$content =
$database->loadObjectlist();
// outputs item name, category & section instead of the select list
<a href="'.
$link .
'" title="'.
T_('Edit Content Item').
'">
'.
$content[0]->category .
'
'.
$content[0]->section .
'
$lists['content'] .=
'<input type="hidden" name="content_item_link" value="'.
$temp[1] .
'" />';
$query =
"SELECT a.id AS value, a.title AS text, a.sectionid, a.catid "
.
"\n FROM #__content AS a"
.
"\n INNER JOIN #__categories AS c ON a.catid = c.id"
.
"\n INNER JOIN #__sections AS s ON a.sectionid = s.id"
.
"\n WHERE a.state = '1'"
.
"\n ORDER BY a.sectionid, a.catid, a.title"
$database->setQuery( $query );
$contents =
$database->loadObjectList( );
foreach ( $contents as $content ) {
$database->setQuery( "SELECT s.title"
.
"\n FROM #__sections AS s"
.
"\n WHERE s.scope = 'content'"
.
"\n AND s.id = '".
$content->sectionid .
"'"
$section =
$database->loadResult();
$database->setQuery( "SELECT c.title"
.
"\n FROM #__categories AS c"
.
"\n WHERE c.id = '".
$content->catid .
"'"
$category =
$database->loadResult();
$value =
$content->value;
$text =
$section .
" - ".
$category .
" / ".
$content->text .
" ";
// Create a list of links
$lists['content'] =
mosHTML::selectList( $contents, 'content_item_link', 'class="inputbox" size="10"', 'value', 'text', '' );
// build html select list for target window
// 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' );
mosRedirect( 'index2.php?option=com_content&task=edit&id='.
$id );
Documentation generated on Mon, 05 May 2008 16:18:42 +0400 by phpDocumentor 1.4.0