/**
     * This presents the main My Galleries page
     * @param array Result array with category details for logged in users
     * @param array Result array with image details for logged in users
     * @param array Result array with pagenav information
     */
    function viewMyGalleriesPage($rows, $images, $pageNav)
    {
        global $rsgConfig, $mainframe;
        $my = JFactory::getUser();
        $database = JFactory::getDBO();
        if (!$rsgConfig->get('show_mygalleries')) {
            $mainframe->redirect($this->myg_url, JText::_('User galleries was disabled by the administrator.'));
        }
        ?>
		<div class="rsg2">
        <h2><?php 
        echo JText::_('My galleries');
        ?>
</h2>

        <?php 
        //Show User information
        myGalleries::RSGalleryUSerInfo($my->id);
        //Start tabs
        jimport("joomla.html.pane");
        $tabs =& JPane::getInstance("Tabs");
        echo $tabs->startPane('tabs');
        echo $tabs->startPanel(JText::_('My Images'), 'my_images');
        myGalleries::showMyImages($images, $pageNav);
        myGalleries::showImageUpload();
        echo $tabs->endPanel();
        if ($rsgConfig->get('uu_createCat')) {
            echo $tabs->startPanel(JText::_('My galleries'), 'my_galleries');
            myGalleries::showMyGalleries($rows);
            myGalleries::showCreateGallery(NULL);
            echo $tabs->endPanel();
        }
        echo $tabs->endPane();
        ?>
		</div>
        <div class='rsg2-clr'>&nbsp;</div>
        <?php 
    }
Example #2
0
function editCat($catid)
{
    //Mirjam: In v1.13 catid was used where since v1.14 gid is used, but locally in a function catid is fine
    global $rsgConfig;
    $my = JFactory::getUser();
    $database = JFactory::getDBO();
    if ($catid) {
        //Edit category
        $database->setQuery("SELECT * FROM #__rsgallery2_galleries WHERE id ='{$catid}'");
        $rows = $database->LoadObjectList();
        myGalleries::editCat($rows);
    } else {
        //Check if maximum number of usercats are already made
        $count = galleryUtils::userCategoryTotal($my->id);
        if ($count >= $rsgConfig->get('uu_maxCat')) {
            $mainframe->redirect(JRoute::_("index.php?option=com_rsgallery2&page=my_galleries"), JText::_('MAX_USERCAT_ALERT'));
        } else {
            //New category
            myGalleries::editCat();
        }
    }
}