Exemplo n.º 1
0
    function displaylist(&$categories, &$rows, $catid, $currentcat = NULL, &$params, $tabclass)
    {
        global $Itemid, $mosConfig_live_site, $hide_js;
        if ($params->get('page_title')) {
            ?>
			<div class="componentheading<?php 
            echo $params->get('pageclass_sfx');
            ?>
">
			<?php 
            echo $currentcat->header;
            ?>
			</div>
			<?php 
        }
        ?>
		<form action="index.php" method="post" name="adminForm">

		<table width="100%" cellpadding="4" cellspacing="0" border="0" align="center" class="contentpane<?php 
        echo $params->get('pageclass_sfx');
        ?>
">
		<tr>
			<td width="60%" valign="top" class="contentdescription<?php 
        echo $params->get('pageclass_sfx');
        ?>
" colspan="2">
			<?php 
        // show image
        if ($currentcat->img) {
            ?>
				<img src="<?php 
            echo $currentcat->img;
            ?>
" align="<?php 
            echo $currentcat->align;
            ?>
" hspace="6" alt="<?php 
            echo T_('Web Links');
            ?>
" />
				<?php 
        }
        echo $currentcat->descrip;
        ?>
			</td>
		</tr>
		<tr>
			<td>
			<?php 
        if (count($rows)) {
            HTML_weblinks::showTable($params, $rows, $catid, $tabclass);
        }
        ?>
			</td>
		</tr>
		<tr>
			<td>&nbsp;

			</td>
		</tr>
		<tr>
			<td>
			<?php 
        // Displays listing of Categories
        if ($params->get('type') == 'category' && $params->get('other_cat')) {
            HTML_weblinks::showCategories($params, $categories, $catid);
        } else {
            if ($params->get('type') == 'section' && $params->get('other_cat_section')) {
                HTML_weblinks::showCategories($params, $categories, $catid);
            }
        }
        ?>
			</td>
		</tr>
		</table>
		</form>
		<?php 
        // displays back button
        mosHTML::BackButton($params, $hide_js);
    }
Exemplo n.º 2
0
/**
* Compiles information to add or edit
* @param integer The unique id of the record to edit (0 if new)
*/
function editWeblink($option, $id)
{
    global $database, $my, $mosConfig_absolute_path;
    $lists = array();
    $row = new mosWeblink($database);
    // load the row from the db table
    $row->load((int) $id);
    // fail if checked out not by 'me'
    if ($row->isCheckedOut($my->id)) {
        mosRedirect('index2.php?option=' . $option, 'The module $row->title is currently being edited by another administrator.');
    }
    if ($id) {
        $row->checkout($my->id);
    } else {
        // initialise new record
        $row->published = 1;
        $row->approved = 1;
        $row->order = 0;
        $row->catid = intval(mosGetParam($_POST, 'catid', 0));
    }
    // build the html select list for ordering
    $query = "SELECT ordering AS value, title AS text" . "\n FROM #__weblinks" . "\n WHERE catid = " . (int) $row->catid . "\n ORDER BY ordering";
    $lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $id, $query, 1);
    // build list of categories
    $lists['catid'] = mosAdminMenus::ComponentCategory('catid', $option, intval($row->catid));
    // build the html select list
    $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published);
    $file = $mosConfig_absolute_path . '/administrator/components/com_weblinks/weblinks_item.xml';
    $params = new mosParameters($row->params, $file, 'component');
    HTML_weblinks::editWeblink($row, $lists, $params, $option);
}
Exemplo n.º 3
0
function editWebLink($id, $option)
{
    global $database, $my;
    global $mosConfig_absolute_path, $mosConfig_live_site;
    if ($my->gid < 1) {
        mosNotAuth();
        return;
    }
    $row = new mosWeblink($database);
    // load the row from the db table
    $row->load($id);
    // fail if checked out not by 'me'
    if ($row->checked_out && $row->checked_out != $my->id) {
        mosRedirect("index2.php?option={$option}", 'The module $row->title is currently being edited by another administrator.');
    }
    if ($id) {
        $row->checkout($my->id);
    } else {
        // initialise new record
        $row->published = 0;
        $row->approved = 0;
        $row->ordering = 0;
    }
    /*
    	// make the select list for the image positions
    	$yesno[] = mosHTML::makeOption( '0', 'No' );
    	$yesno[] = mosHTML::makeOption( '1', 'Yes' );
    	// build the html select list
    	$applist = mosHTML::selectList( $yesno, 'approved', 'class="inputbox" size="2"', 'value', 'text', $row->approved );
    	// build the html select list for ordering
    	$query = "SELECT ordering AS value, title AS text"
    	. "\n FROM #__weblinks"
    	. "\n WHERE catid='$row->catid'"
    	. "\n ORDER BY ordering"
    	;
    	$lists['ordering'] 			= mosAdminMenus::SpecificOrdering( $row, $id, $query, 1 ); 
    */
    // build list of categories
    $lists['catid'] = mosAdminMenus::ComponentCategory('catid', $option, intval($row->catid));
    HTML_weblinks::editWeblink($option, $row, $lists);
}
Exemplo n.º 4
0
function editWebLink($id, $option)
{
    global $database, $my;
    if ($my->gid < 1) {
        mosNotAuth();
        return;
    }
    // security check to see if link exists in a menu
    $link = 'index.php?option=com_weblinks&task=new';
    $query = "SELECT id" . "\n FROM #__menu" . "\n WHERE link LIKE '%{$link}%'" . "\n AND published = 1";
    $database->setQuery($query);
    $exists = $database->loadResult();
    if (!$exists) {
        mosNotAuth();
        return;
    }
    $row = new mosWeblink($database);
    // load the row from the db table
    $row->load((int) $id);
    // fail if checked out not by 'me'
    if ($row->isCheckedOut($my->id)) {
        mosRedirect("index2.php?option={$option}", 'The module $row->title is currently being edited by another administrator.');
    }
    if ($id) {
        $row->checkout($my->id);
    } else {
        // initialise new record
        $row->published = 0;
        $row->approved = 1;
        $row->ordering = 0;
    }
    // build list of categories
    $lists['catid'] = mosAdminMenus::ComponentCategory('catid', $option, intval($row->catid));
    HTML_weblinks::editWeblink($option, $row, $lists);
}
Exemplo n.º 5
0
/**
* Compiles information to add or edit
* @param integer The unique id of the record to edit (0 if new)
*/
function editWeblink($option, $id)
{
    global $database, $my, $mosConfig_absolute_path, $mosConfig_live_site;
    global $adminLanguage;
    $lists = array();
    $row = new mosWeblink($database);
    // load the row from the db table
    $row->load($id);
    // fail if checked out not by 'me'
    if ($row->checked_out && $row->checked_out != $my->id) {
        mosRedirect("index2.php?option=" . $option, $adminLanguage->A_COMP_CONTENT_MODULE . " " . $row->title . " " . $adminLanguage->A_COMP_ANOTHER_ADMIN);
    }
    if ($id) {
        $row->checkout($my->id);
    } else {
        // initialise new record
        $row->published = 1;
        $row->approved = 1;
        $row->order = 0;
    }
    // build the html select list for ordering
    $query = "SELECT ordering AS value, title AS text" . "\n FROM #__weblinks" . "\n WHERE catid='{$row->catid}'" . "\n ORDER BY ordering";
    $lists['ordering'] = mosAdminMenus::SpecificOrdering($row, $id, $query, 1);
    // build list of categories
    $lists['catid'] = mosAdminMenus::ComponentCategory('catid', $option, intval($row->catid));
    // build the html select list
    $lists['approved'] = mosHTML::yesnoRadioList('approved', 'class="inputbox"', $row->approved);
    // build the html select list
    $lists['published'] = mosHTML::yesnoRadioList('published', 'class="inputbox"', $row->published);
    HTML_weblinks::editWeblink($row, $lists, $option);
}