<?  // PHPmyGallery - backend core - start page

/* File description:

This file processes the start page from the admin menu.

### What this script does:
###
### Included from: adminmenu.index.php
### |
### | (Uses templates from index_view)
### +- Adminmenu Index View (Load and display Groups&Galeries, Display Tip of the moment, Display license)
###
*/ 

// Load license text
$pktpl_vars['text_license'] = implode("<br>\n",file('licensed_to.txt'));

// Tip of the moment
$tipNo = rand(1,count($tip));
$pktpl_vars['text_tipoftheMoment'] = (isset($tip[$tipNo])) ? $tip[$tipNo]: $tip[1];

// Load & display Groups&Galleries
$arr  = filenames2arr($conf['pathToGroups'],GROUPS);
$rows = '';
foreach($arr as $group) {
    $pktpl_vars['text_groupname'] = $group;
    $rows                        .= pktpl('adminmenu/index_view/indexTableGroupRow.html');
    
    $arr2 = filenames2arr($conf['pathToGroups'].$group.'/',DIRECTORIES);
    foreach($arr2 as $dir) {
        $pktpl_vars['text_gallerydir'] = $dir;
        
        $rows .= pktpl('adminmenu/index_view/indexTableGalleryRows.html');
    } // foreach
} // foreach

// Make templates
$pktpl_vars['template_admin_indexTableRows']              = $rows;
$pktpl_vars['template_admin_indexTableMainsetupandStats'] = pktpl('adminmenu/index_view/indexTableMainsetupandStats.html');
$pktpl_vars['template_admin_indexTableGallerysetup']      = pktpl('adminmenu/index_view/indexTableGallerysetup.html');
$pktpl_vars['template_admin_table']                       = pktpl('adminmenu/index_view/indexTable.html');

?>