administrator/components/com_categories/admin.categories.php-Dateireferenz

gehe zum Quellcode dieser Datei

Namensbereiche

namespace  Joomla

Aufzählungen

enum  COM_IMAGE_BASE

Funktionen

 accessMenu ($uid, $access, $section)
 cancelCategory ()
 copyCategorySave ($cid, $sectionOld)
 copyCategorySelect ($option, $cid, $sectionOld)
 editCategory ($uid=0, $section='')
 menuLink ($id)
 moveCategorySave ($cid, $sectionOld)
 moveCategorySelect ($option, $cid, $sectionOld)
 orderCategory ($uid, $inc)
 publishCategories ($section, $categoryid=null, $cid=null, $publish=1)
 recursive_listdir ($base)
 removeCategories ($section, $cid)
 saveCategory ($task)
 saveOrder (&$cid, $section)
 showCategories ($section, $option)

Variablen

 $cid = josGetArrayInts( 'cid' )
case $id
default $option
 $section = stripslashes( strval( mosGetParam( $_REQUEST, 'section', 'content' ) ) )
case __pad0__
case __pad10__
case __pad11__
case __pad12__
case __pad13__
case __pad14__
case __pad15__
case __pad16__
default __pad17__
case __pad1__
case __pad2__
case __pad3__
case __pad4__
case __pad5__
case __pad6__
case __pad7__
case __pad8__
case __pad9__
 break


Dokumentation der Aufzählungstypen

Definiert in Zeile 20 der Datei admin.categories.php.


Dokumentation der Funktionen

accessMenu ( uid,
access,
section 
)

changes the access level of a record

Parameter:
integer The increment to reorder by

Definiert in Zeile 990 der Datei admin.categories.php.

Benutzt $access, $database, $row, $section, mosCache::cleanCache() und mosRedirect().

00990                                                {
00991         global $database;
00992 
00993         $row = new mosCategory( $database );
00994         $row->load( (int)$uid );
00995         $row->access = $access;
00996 
00997         if ( !$row->check() ) {
00998                 return $row->getError();
00999         }
01000         if ( !$row->store() ) {
01001                 return $row->getError();
01002         }
01003 
01004         if ($section == 'content') {
01005                 // clean any existing cache files
01006                 mosCache::cleanCache( 'com_content' );
01007         }
01008 
01009         mosRedirect( 'index2.php?option=com_categories&section='. $section );
01010 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

cancelCategory (  ) 

Cancels an edit operation

Parameter:
string The name of the category section
integer A unique category id

Definiert in Zeile 725 der Datei admin.categories.php.

Benutzt $database, $row, josSpoofCheck(), mosGetParam() und mosRedirect().

00725                           {
00726         global $database;
00727         
00728         josSpoofCheck();
00729 
00730         $redirect = strval( mosGetParam( $_POST, 'redirect', '' ) );
00731 
00732         $row = new mosCategory( $database );
00733         $row->bind( $_POST );
00734         $row->checkin();
00735 
00736         mosRedirect( 'index2.php?option=com_categories&section='. $redirect );
00737 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

copyCategorySave ( cid,
sectionOld 
)

Save the item(s) to the menu selected

Definiert in Zeile 915 der Datei admin.categories.php.

Benutzt $cid, $content, $database, $id, $msg, $total, mosCache::cleanCache(), josGetArrayInts(), josSpoofCheck(), mosGetParam(), mosRedirect() und NULL.

00915                                                {
00916         global $database;
00917         
00918         josSpoofCheck();
00919 
00920         $sectionMove    = intval( mosGetParam( $_REQUEST, 'sectionmove', '' ) );
00921         if ( !$sectionMove ) {
00922                 mosRedirect( 'index.php?option=com_categories&mosmsg=An error has occurred' );
00923         }
00924 
00925         $contentid              = josGetArrayInts( 'item', $_REQUEST );
00926         $total                  = count( $contentid  );
00927 
00928         $category = new mosCategory ( $database );
00929         foreach( $cid as $id ) {
00930                 $category->load( (int)$id );
00931                 $category->id           = NULL;
00932                 $category->title        = 'Copy of '. $category->title;
00933                 $category->name         = 'Copy of '. $category->name;
00934                 $category->section      = $sectionMove;
00935                 if (!$category->check()) {
00936                         echo "<script> alert('".$category->getError()."'); window.history.go(-1); </script>\n";
00937                         exit();
00938                 }
00939 
00940                 if (!$category->store()) {
00941                         echo "<script> alert('".$category->getError()."'); window.history.go(-1); </script>\n";
00942                         exit();
00943                 }
00944                 $category->checkin();
00945                 // stores original catid
00946                 $newcatids[]["old"] = $id;
00947                 // pulls new catid
00948                 $newcatids[]["new"] = $category->id;
00949         }
00950 
00951         $content = new mosContent ( $database );
00952         foreach( $contentid as $id) {
00953                 $content->load( (int)$id );
00954                 $content->id            = NULL;
00955                 $content->sectionid = $sectionMove;
00956                 $content->hits          = 0;
00957                 foreach( $newcatids as $newcatid ) {
00958                         if ( $content->catid == $newcatid['old'] ) {
00959                                 $content->catid = $newcatid['new'];
00960                         }
00961                 }
00962                 if (!$content->check()) {
00963                         echo "<script> alert('".$content->getError()."'); window.history.go(-1); </script>\n";
00964                         exit();
00965                 }
00966 
00967                 if (!$content->store()) {
00968                         echo "<script> alert('".$content->getError()."'); window.history.go(-1); </script>\n";
00969                         exit();
00970                 }
00971                 $content->checkin();
00972         }
00973 
00974         $sectionNew = new mosSection ( $database );
00975         $sectionNew->load( $sectionMove );
00976 
00977         if ($sectionOld == 'content') {
00978                 // clean any existing cache files
00979                 mosCache::cleanCache( 'com_content' );
00980         }
00981 
00982         $msg = ( (count($cid) - 1) ? 'Categories' : 'Category' ) .' copied to '. $sectionNew->name;
00983         mosRedirect( 'index2.php?option=com_categories&section='. $sectionOld .'&mosmsg='. $msg );
00984 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

copyCategorySelect ( option,
cid,
sectionOld 
)

Form for copying item(s) to a specific menu

Definiert in Zeile 865 der Datei admin.categories.php.

Benutzt $cid, $database, $items, $option, $query, categories_html::copyCategorySelect(), mosArrayToInts(), mosGetParam() und mosHTML::selectList().

00865                                                           {
00866         global $database;
00867 
00868         $redirect = mosGetParam( $_POST, 'section', 'content' );;
00869 
00870         if (!is_array( $cid ) || count( $cid ) < 1) {
00871                 echo "<script> alert('Select an item to move'); window.history.go(-1);</script>\n";
00872                 exit;
00873         }
00874 
00875         ## query to list selected categories
00876         mosArrayToInts( $cid );
00877         $cids = 'a.id=' . implode( ' OR a.id=', $cid );
00878         $query = "SELECT a.name, a.section"
00879         . "\n FROM #__categories AS a"
00880         . "\n WHERE ( $cids )"
00881         ;
00882         $database->setQuery( $query );
00883         $items = $database->loadObjectList();
00884 
00885         ## query to list items from categories
00886         // mosArrayToInts( $cid ); // Just done a few lines earlier
00887         $cids = 'a.catid=' . implode( ' OR a.catid=', $cid );
00888         $query = "SELECT a.title, a.id"
00889         . "\n FROM #__content AS a"
00890         . "\n WHERE ( $cids )"
00891         . "\n ORDER BY a.catid, a.title"
00892         ;
00893         $database->setQuery( $query );
00894         $contents = $database->loadObjectList();
00895 
00896         ## query to choose section to move to
00897         $query = "SELECT a.name AS `text`, a.id AS `value`"
00898         . "\n FROM #__sections AS a"
00899         . "\n WHERE a.published = 1"
00900         . "\n ORDER BY a.name"
00901         ;
00902         $database->setQuery( $query );
00903         $sections = $database->loadObjectList();
00904 
00905         // build the html select list
00906         $SectionList = mosHTML::selectList( $sections, 'sectionmove', 'class="inputbox" size="10"', 'value', 'text', null );
00907 
00908         categories_html::copyCategorySelect( $option, $cid, $SectionList, $items, $sectionOld, $contents, $redirect );
00909 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

editCategory ( uid = 0,
section = '' 
)

Compiles information to add or edit a category

Parameter:
string The name of the category section
integer The unique id of the category to edit (0 if new)
string The name of the current user

Definiert in Zeile 259 der Datei admin.categories.php.

Benutzt $and, $count, $database, $i, $link, $mainframe, $my, $params, $query, $row, $section, $type, categories_html::edit(), mosHTML::makeOption(), mosGetParam(), mosRedirect(), NULL, recursive_listdir(), mosHTML::selectList() und mosHTML::yesnoRadioList().

00259                                              {
00260         global $database, $my, $mainframe;
00261 
00262         $type           = strval( mosGetParam( $_REQUEST, 'type', '' ) );
00263         $redirect       = strval( mosGetParam( $_REQUEST, 'section', 'content' ) );
00264 
00265         // check for existance of any sections
00266         $query = "SELECT COUNT( id )"
00267         . "\n FROM #__sections"
00268         . "\n WHERE scope = 'content'"
00269         ;
00270         $database->setQuery( $query );
00271         $sections = $database->loadResult();
00272         if (!$sections && $type != 'other') {
00273                 echo "<script> alert('You need to have at least one Section before you can create a Category'); window.history.go(-1); </script>\n";
00274                 exit();
00275         }
00276 
00277         $row = new mosCategory( $database );
00278         // load the row from the db table
00279         $row->load( (int)$uid );
00280 
00281         // fail if checked out not by 'me'
00282         if ($row->checked_out && $row->checked_out != $my->id) {
00283                 mosRedirect( 'index2.php?option=categories&section='. $row->section, 'The category '. $row->title .' is currently being edited by another administrator' );
00284         }
00285 
00286         $lists['links']         = 0;
00287         $menus                          = NULL;
00288         $selected_folders       = NULL;
00289         if ( $uid ) {
00290                 // existing record
00291                 $row->checkout( $my->id );
00292 
00293                 // code for Link Menu
00294                 switch ( $row->section ) {
00295                         case 'com_weblinks':
00296                                 $and    = "\n AND type = 'weblink_category_table'";
00297                                 $link   = 'Table - Weblink Category';
00298                                 break;
00299 
00300                         case 'com_newsfeeds':
00301                                 $and    = "\n AND type = 'newsfeed_category_table'";
00302                                 $link   = 'Table - Newsfeeds Category';
00303                                 break;
00304 
00305                         case 'com_contact_details':
00306                                 $and    = "\n AND type = 'contact_category_table'";
00307                                 $link   = 'Table - Contacts Category';
00308                                 break;
00309 
00310                         default:
00311                                 $and  = '';
00312                                 $link = '';
00313                                 break;
00314                 }
00315 
00316                 // content
00317                 if ( $row->section > 0 ) {
00318                         $query = "SELECT *"
00319                         . "\n FROM #__menu"
00320                         . "\n WHERE componentid = " . (int) $row->id
00321                         . "\n AND ( type = 'content_archive_category' OR type = 'content_blog_category' OR type = 'content_category' )"
00322                         ;
00323                         $database->setQuery( $query );
00324                         $menus = $database->loadObjectList();
00325 
00326                         $count = count( $menus );
00327                         for( $i = 0; $i < $count; $i++ ) {
00328                                 switch ( $menus[$i]->type ) {
00329                                         case 'content_category':
00330                                                 $menus[$i]->type = 'Table - Content Category';
00331                                                 break;
00332 
00333                                         case 'content_blog_category':
00334                                                 $menus[$i]->type = 'Blog - Content Category';
00335                                                 break;
00336 
00337                                         case 'content_archive_category':
00338                                                 $menus[$i]->type = 'Blog - Content Category Archive';
00339                                                 break;
00340                                 }
00341                         }
00342                         $lists['links'] = 1;
00343 
00344                         // handling for MOSImage directories
00345                         if ( trim( $row->params ) ) {
00346                                 // get params definitions
00347                                 $params = new mosParameters( $row->params, $mainframe->getPath( 'com_xml', 'com_categories' ), 'component' );
00348                                 $temps  = $params->get( 'imagefolders', '' );
00349 
00350                                 $temps  = explode( ',', $temps );
00351                                 foreach( $temps as $temp ) {
00352                                         $selected_folders[] = mosHTML::makeOption( $temp, $temp );
00353                                 }
00354                         } else {
00355                                 $selected_folders[] = mosHTML::makeOption( '*2*' );
00356                         }
00357                 } else {
00358                         $query = "SELECT *"
00359                         . "\n FROM #__menu"
00360                         . "\n WHERE componentid = " . (int) $row->id
00361                         . $and
00362                         ;
00363                         $database->setQuery( $query );
00364                         $menus = $database->loadObjectList();
00365 
00366                         $count = count( $menus );
00367                         for( $i = 0; $i < $count; $i++ ) {
00368                                 $menus[$i]->type = $link;
00369                         }
00370                         $lists['links'] = 1;
00371                 }
00372         } else {
00373                 // new record
00374                 $row->section           = $section;
00375                 $row->published         = 1;
00376                 $menus                          = NULL;
00377 
00378                 // handling for MOSImage directories
00379                 if ( $row->section == 'content' ) {
00380                         $selected_folders[]     = mosHTML::makeOption( '*2*' );
00381                 }
00382         }
00383 
00384         // make order list
00385         $order = array();
00386         $query = "SELECT COUNT(*)"
00387         . "\n FROM #__categories"
00388         . "\n WHERE section = " . $database->Quote( $row->section )
00389         ;
00390         $database->setQuery( $query );
00391         $max = intval( $database->loadResult() ) + 1;
00392 
00393         for ($i=1; $i < $max; $i++) {
00394                 $order[] = mosHTML::makeOption( $i );
00395         }
00396 
00397         // build the html select list for sections
00398         if ( $section == 'content' ) {
00399                 $query = "SELECT s.id AS value, s.title AS text"
00400                 . "\n FROM #__sections AS s"
00401                 . "\n ORDER BY s.ordering"
00402                 ;
00403                 $database->setQuery( $query );
00404                 $sections = $database->loadObjectList();
00405                 $lists['section'] = mosHTML::selectList( $sections, 'section', 'class="inputbox" size="1"', 'value', 'text' );;
00406         } else {
00407                 if ( $type == 'other' ) {
00408                         $section_name = 'N/A';
00409                 } else {
00410                         $temp = new mosSection( $database );
00411                         $temp->load( $row->section );
00412                         $section_name = $temp->name;
00413                 }
00414                 $lists['section'] = '<input type="hidden" name="section" value="'. $row->section .'" />'. $section_name;
00415         }
00416 
00417         // build the html select list for category types
00418         $types[] = mosHTML::makeOption( '', 'Select Type' );
00419         if ($row->section == 'com_contact_details') {
00420                 $types[] = mosHTML::makeOption( 'contact_category_table', 'Contact Category Table' );
00421         } else
00422         if ($row->section == 'com_newsfeeds') {
00423                 $types[] = mosHTML::makeOption( 'newsfeed_category_table', 'Newsfeed Category Table' );
00424         } else
00425         if ($row->section == 'com_weblinks') {
00426                 $types[] = mosHTML::makeOption( 'weblink_category_table', 'Weblink Category Table' );
00427         } else {
00428                 $types[] = mosHTML::makeOption( 'content_category', 'Content Category Table' );
00429                 $types[] = mosHTML::makeOption( 'content_blog_category', 'Content Category Blog' );
00430                 $types[] = mosHTML::makeOption( 'content_archive_category', 'Content Category Archive Blog' );
00431         } // if
00432         $lists['link_type']             = mosHTML::selectList( $types, 'link_type', 'class="inputbox" size="1"', 'value', 'text' );
00433 
00434         // build the html select list for ordering
00435         $query = "SELECT ordering AS value, title AS text"
00436         . "\n FROM #__categories"
00437         . "\n WHERE section = " . $database->Quote( $row->section )
00438         . "\n ORDER BY ordering"
00439         ;
00440         $lists['ordering']                      = stripslashes( mosAdminMenus::SpecificOrdering( $row, $uid, $query ));
00441 
00442         // build the select list for the image positions
00443         $active =  ( $row->image_position ? $row->image_position : 'left' );
00444         $lists['image_position']        = mosAdminMenus::Positions( 'image_position', $active, NULL, 0, 0 );
00445         // Imagelist
00446         $lists['image']                         = mosAdminMenus::Images( 'image', $row->image );
00447         // build the html select list for the group access
00448         $lists['access']                        = mosAdminMenus::Access( $row );
00449         // build the html radio buttons for published
00450         $lists['published']             = mosHTML::yesnoRadioList( 'published', 'class="inputbox"', $row->published );
00451         // build the html select list for menu selection
00452         $lists['menuselect']            = mosAdminMenus::MenuSelect( );
00453 
00454         // handling for MOSImage directories
00455         if ( $row->section > 0 || $row->section == 'content' ) {
00456                 // list of folders in images/stories/
00457                 $imgFiles       = recursive_listdir( COM_IMAGE_BASE );
00458                 $len            = strlen( COM_IMAGE_BASE );
00459 
00460                 $folders[]      = mosHTML::makeOption( '*2*', 'Use Section settings'  );
00461                 $folders[]      = mosHTML::makeOption( '*#*', '---------------------' );
00462                 $folders[]      = mosHTML::makeOption( '*1*', 'All'  );
00463                 $folders[]      = mosHTML::makeOption( '*0*', 'None' );
00464                 $folders[]      = mosHTML::makeOption( '*#*', '---------------------' );
00465                 $folders[]      = mosHTML::makeOption( '/' );
00466                 foreach ($imgFiles as $file) {
00467                         $folders[] = mosHTML::makeOption( substr( $file, $len ) );
00468                 }
00469 
00470                 $lists['folders'] = mosHTML::selectList( $folders, 'folders[]', 'class="inputbox" size="17" multiple="multiple"', 'value', 'text', $selected_folders );
00471         }
00472 
00473         categories_html::edit( $row, $lists, $redirect, $menus );
00474 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

menuLink ( id  ) 

Definiert in Zeile 1012 der Datei admin.categories.php.

Benutzt $database, $id, $link, $menu, $menutype, $msg, $name, $row, $sectionid, $type, ampReplace(), mosCache::cleanCache(), josSpoofCheck(), mosGetParam() und mosRedirect().

Wird benutzt von save(), saveCategory(), saveContent() und saveSection().

01012                          {
01013         global $database;
01014         
01015         josSpoofCheck();
01016 
01017         $category = new mosCategory( $database );
01018         $category->bind( $_POST );
01019         $category->checkin();
01020 
01021         $redirect       = strval( mosGetParam( $_POST, 'redirect', '' ) );
01022         $menu           = stripslashes( strval( mosGetParam( $_POST, 'menuselect', '' ) ) );
01023         $name           = strval( mosGetParam( $_POST, 'link_name', '' ) );
01024         $sectionid      = mosGetParam( $_POST, 'sectionid', '' );
01025         $type           = strval( mosGetParam( $_POST, 'link_type', '' ) );
01026 
01027         $name           = stripslashes( ampReplace($name) );
01028 
01029         switch ( $type ) {
01030                 case 'content_category':
01031                         $link           = 'index.php?option=com_content&task=category&sectionid='. $sectionid .'&id='. $id;
01032                         $menutype       = 'Content Category Table';
01033                         break;
01034 
01035                 case 'content_blog_category':
01036                         $link           = 'index.php?option=com_content&task=blogcategory&id='. $id;
01037                         $menutype       = 'Content Category Blog';
01038                         break;
01039 
01040                 case 'content_archive_category':
01041                         $link           = 'index.php?option=com_content&task=archivecategory&id='. $id;
01042                         $menutype       = 'Content Category Blog Archive';
01043                         break;
01044 
01045                 case 'contact_category_table':
01046                         $link           = 'index.php?option=com_contact&catid='. $id;
01047                         $menutype       = 'Contact Category Table';
01048                         break;
01049 
01050                 case 'newsfeed_category_table':
01051                         $link           = 'index.php?option=com_newsfeeds&catid='. $id;
01052                         $menutype       = 'Newsfeed Category Table';
01053                         break;
01054 
01055                 case 'weblink_category_table':
01056                         $link           = 'index.php?option=com_weblinks&catid='. $id;
01057                         $menutype       = 'Weblink Category Table';
01058                         break;
01059         }
01060 
01061         $row                            = new mosMenu( $database );
01062         $row->menutype          = $menu;
01063         $row->name                      = $name;
01064         $row->type                      = $type;
01065         $row->published         = 1;
01066         $row->componentid       = $id;
01067         $row->link                      = $link;
01068         $row->ordering          = 9999;
01069 
01070         if ( $type == 'content_blog_category' ) {
01071                 $row->params = 'categoryid='. $id;
01072         }
01073 
01074         if (!$row->check()) {
01075                 echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
01076                 exit();
01077         }
01078         if (!$row->store()) {
01079                 echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
01080                 exit();
01081         }
01082         $row->checkin();
01083         $row->updateOrder( "menutype = " . $database->Quote( $menu ) );
01084 
01085         if ($redirect == 'content') {
01086                 // clean any existing cache files
01087                 mosCache::cleanCache( 'com_content' );
01088         }
01089 
01090         $msg = $name .' ( '. $menutype .' ) in menu: '. $menu .' successfully created';
01091         mosRedirect( 'index2.php?option=com_categories&section='. $redirect .'&task=editA&hidemainmenu=1&id='. $id, $msg );
01092 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

Hier ist ein Graph der zeigt, wo diese Funktion aufgerufen wird:

moveCategorySave ( cid,
sectionOld 
)

Save the item(s) to the menu selected

Definiert in Zeile 811 der Datei admin.categories.php.

Benutzt $cid, $database, $msg, $query, $total, mosCache::cleanCache(), josSpoofCheck(), mosArrayToInts(), mosGetParam() und mosRedirect().

00811                                                {
00812         global $database;
00813         
00814         josSpoofCheck();
00815 
00816         if (!is_array( $cid ) || count( $cid ) < 1) {
00817                 echo "<script> alert('Select an item to move'); window.history.go(-1);</script>\n";
00818                 exit;
00819         }
00820 
00821         $sectionMove    = intval( mosGetParam( $_REQUEST, 'sectionmove', '' ) );
00822         if ( !$sectionMove ) {
00823                 mosRedirect( 'index.php?option=com_categories&mosmsg=An error has occurred' );
00824         }
00825 
00826         $total = count( $cid );
00827 
00828         mosArrayToInts( $cid );
00829         $cids = 'id=' . implode( ' OR id=', $cid );
00830         $query = "UPDATE #__categories"
00831         . "\n SET section = " . $sectionMove
00832         . "\n WHERE ( $cids )"
00833         ;
00834         $database->setQuery( $query );
00835         if ( !$database->query() ) {
00836                 echo "<script> alert('". $database->getErrorMsg() ."'); window.history.go(-1); </script>\n";
00837                 exit();
00838         }
00839         // mosArrayToInts( $cid ); // Just done a few lines earlier
00840         $cids = 'catid=' . implode( ' OR catid=', $cid );
00841         $query = "UPDATE #__content"
00842         . "\n SET sectionid = " . $sectionMove
00843         . "\n WHERE ( $cids )"
00844         ;
00845         $database->setQuery( $query );
00846         if ( !$database->query() ) {
00847                 echo "<script> alert('". $database->getErrorMsg() ."'); window.history.go(-1); </script>\n";
00848                 exit();
00849         }
00850         $sectionNew = new mosSection ( $database );
00851         $sectionNew->load( $sectionMove );
00852 
00853         if ($sectionOld == 'content') {
00854                 // clean any existing cache files
00855                 mosCache::cleanCache( 'com_content' );
00856         }
00857 
00858         $msg = ( (count($cid) - 1) ? 'Categories' : 'Category' ) .' moved to '. $sectionNew->name;
00859         mosRedirect( 'index2.php?option=com_categories&section='. $sectionOld .'&mosmsg='. $msg );
00860 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

moveCategorySelect ( option,
cid,
sectionOld 
)

Form for moving item(s) to a specific menu

Definiert in Zeile 761 der Datei admin.categories.php.

Benutzt $cid, $database, $items, $option, $query, mosArrayToInts(), mosGetParam(), categories_html::moveCategorySelect() und mosHTML::selectList().

00761                                                           {
00762         global $database;
00763 
00764         $redirect = mosGetParam( $_POST, 'section', 'content' );;
00765 
00766         if (!is_array( $cid ) || count( $cid ) < 1) {
00767                 echo "<script> alert('Select an item to move'); window.history.go(-1);</script>\n";
00768                 exit;
00769         }
00770 
00771         ## query to list selected categories
00772         mosArrayToInts( $cid );
00773         $cids = 'a.id=' . implode( ' OR a.id=', $cid );
00774         $query = "SELECT a.name, a.section"
00775         . "\n FROM #__categories AS a"
00776         . "\n WHERE ( $cids )"
00777         ;
00778         $database->setQuery( $query );
00779         $items = $database->loadObjectList();
00780 
00781         ## query to list items from categories
00782         // mosArrayToInts( $cid ); // Just done a few lines earlier
00783         $cids = 'a.catid=' . implode( ' OR a.catid=', $cid );
00784         $query = "SELECT a.title"
00785         . "\n FROM #__content AS a"
00786         . "\n WHERE ( $cids )"
00787         . "\n ORDER BY a.catid, a.title"
00788         ;
00789         $database->setQuery( $query );
00790         $contents = $database->loadObjectList();
00791 
00792         ## query to choose section to move to
00793         $query = "SELECT a.name AS text, a.id AS value"
00794         . "\n FROM #__sections AS a"
00795         . "\n WHERE a.published = 1"
00796         . "\n ORDER BY a.name"
00797         ;
00798         $database->setQuery( $query );
00799         $sections = $database->loadObjectList();
00800 
00801         // build the html select list
00802         $SectionList = mosHTML::selectList( $sections, 'sectionmove', 'class="inputbox" size="10"', 'value', 'text', null );
00803 
00804         categories_html::moveCategorySelect( $option, $cid, $SectionList, $items, $sectionOld, $contents, $redirect );
00805 }

Hier ist ein Graph der zeigt, was diese Funktion aufruft:

orderCategory ( uid,
inc 
)

Moves the order of a record

Parameter:
integer The increment to reorder by

Definiert in Zeile 743 der Datei admin.categories.php.

Benutzt $database, $row, mosCache::cleanCache(), josSpoofCheck() und mosRedirect().

00743                                      {
00744         global $database;
00745         
00746         josSpoofCheck();
00747 
00748         $row = new mosCategory( $database );
00749         $row->load( (in