Пример #1
0
/**
* Moves the order of a record
* @param integer The increment to reorder by
*/
function orderWeblinks($uid, $inc, $option)
{
    josSpoofCheck();
    global $database;
    $row = new mosWeblink($database);
    $row->load((int) $uid);
    $row->updateOrder();
    $row->move($inc, "published >= 0");
    $row->updateOrder();
    mosRedirect("index2.php?option={$option}");
}
Пример #2
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);
}
Пример #3
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);
}
Пример #4
0
/**
* Moves the order of a record
* @param integer The increment to reorder by
*/
function orderWeblinks($uid, $inc, $option)
{
    global $database;
    $row = new mosWeblink($database);
    $row->load($uid);
    $row->move($inc, "published >= 0");
    mosRedirect("index2.php?option={$option}");
}