Exemplo n.º 1
0
 function showSlideShow()
 {
     global $rsgConfig;
     $gallery = rsgGalleryManager::get();
     // show nothing if there are no items
     if (!$gallery->itemCount()) {
         return;
     }
     $k = 0;
     $text = "";
     foreach ($gallery->items() as $item) {
         if ($item->type != 'image') {
             return;
         }
         $display = $item->display();
         $thumb = $item->thumb();
         //The subtitleSelector for jd.gallery.js is p. This interferes with any
         //p-tags in the item desciption. Changing p tag to div.descr tag works for Firefox
         //but not for IE (tested IE7). So removing p tags from item description:
         $search[] = '<p>';
         $search[] = '</p>';
         $replace = ' ';
         $item->descr = str_replace($search, $replace, $item->descr);
         $text .= "<div class=\"imageElement\">" . "<h3>{$item->title}</h3>" . "<p>{$item->descr}</p>" . "<a href=\"#\" title=\"open image\" class=\"open\"></a>" . "<img src=\"" . $display->url() . "\" class=\"full\" />" . "<img src=\"" . $thumb->url() . "\" class=\"thumbnail\" />" . "</div>";
         $k++;
     }
     $this->slides = $text;
     $this->galleryname = $gallery->name;
     $this->gid = $gallery->id;
     $this->display('slideshow.php');
 }
Exemplo n.º 2
0
/**
    prints gallery id, name and id, name of all items, recursively
    @param int id of gallery
**/
function listEverything($parent = 0)
{
    global $rsgConfig;
    if (!$rsgConfig->get('debug')) {
        echo '<p>Error: Debug must be enabled to use this debug tool.</p>';
        return;
    }
    require_once JPATH_RSGALLERY2_ADMIN . '/includes/gallery.class.php';
    $g = rsgGalleryManager::get($parent);
    function printItemsList($gallery)
    {
        echo <<<EOD
<br />Images:<table border='1' class='rsg-image-table' >
    <tr>
        <th>id</th>
        <th>ordering</th>
        <th>name</th>
        <th>thumbnail</th>
    </tr>
EOD;
        foreach ($gallery->itemRows() as $item) {
            echo "<tr>";
            echo '<td>';
            echo $item['id'];
            echo '</td>';
            echo '<td>';
            echo $item['ordering'];
            echo '</td>';
            echo '<td>';
            echo $item['name'];
            echo '</td>';
            echo '<td>';
            echo "<img src='" . imgUtils::getImgThumb($item['name']) . "' width='30' height='30' />";
            echo '</td>';
            echo "</tr>";
        }
        echo "</table>";
    }
    function printList($gallery)
    {
        echo "<ul>";
        foreach ($gallery->kids() as $kid) {
            echo "<li>" . $kid->get('id') . " " . $kid->get('name');
            printItemsList($kid);
            printList($kid);
            echo "</li>";
        }
        echo "</ul>";
    }
    printList($g);
}
Exemplo n.º 3
0
 function showSlideShow()
 {
     global $rsgConfig;
     $gallery = rsgGalleryManager::get();
     // show nothing if there are no items
     if (!$gallery->itemCount()) {
         return;
     }
     $k = 0;
     $text = "";
     foreach ($gallery->items() as $item) {
         if ($item->type != 'image') {
             return;
         }
         $display = $item->display();
         $text .= "SLIDES[" . $k . "] = ['" . $display->url() . "', '{$item->title}'];\n";
         $k++;
     }
     $this->slides = $text;
     $this->display('slideshow.php');
 }
Exemplo n.º 4
0
 function showSlideShow()
 {
     global $rsgConfig;
     $gallery = rsgGalleryManager::get();
     // show nothing if there are no items
     if (!$gallery->itemCount()) {
         return;
     }
     $k = 0;
     $text = "";
     foreach ($gallery->items() as $item) {
         if ($item->type != 'image') {
             return;
         }
         $display = $item->display();
         $thumb = $item->thumb();
         $text .= "<a href=\"" . $display->url() . "\" class=\"slideshowThumbnail\"><img src=\"" . $thumb->url() . "\" border=\"0\" /></a>";
         $k++;
     }
     $this->slides = $text;
     $this->galleryname = $gallery->name;
     $this->gid = $gallery->id;
     $this->display('slideshow.php');
 }
Exemplo n.º 5
0
 /**
  * Returns the selected gallery.
  *
  * @static
  * @deprecated Use rsgGalleryManager::get(); instead!
  */
 function getGallery()
 {
     return rsgGalleryManager::get();
 }
Exemplo n.º 6
0
 /** get local path to gallery
  * @param string char to separate path with (default = DS)
  * @return path to gallery
  **/
 function getPath($path_separator = '/')
 {
     global $rsgConfig;
     static $path = null;
     // return cached path if it is available
     if ($path != null) {
         return $path;
     }
     // check if the galleries are stored in separate folders
     if ($rsgConfig->get('gallery_folders')) {
         // if the gallery is in the root, return empty string
         if ($this->parent == null) {
             $path = '';
         } else {
             // if gallery is a sub gallery the get the path ftrom the parent
             $parent_gallery = rsgGalleryManager::get($this->parent);
             $path = $parent_gallery->getPath($path_separator) . $path_separator . $this->id;
         }
     } else {
         $path = $path_separator;
     }
     return $path;
 }
Exemplo n.º 7
0
 /**
  * Checks if it is allowed to vote in this gallery
  * @return True or False
  */
 function voteAllowed()
 {
     global $rsgConfig, $rsgAccess;
     //Check if voting is enabled
     if ($rsgConfig->get('voting') < 1) {
         return false;
     } else {
         $gallery = rsgGalleryManager::get();
         return $rsgAccess->checkGallery("vote_vote", $gallery->id);
     }
 }
Exemplo n.º 8
0
    /**
     * show list of galleries
     */
    function show(&$rows, &$lists, &$search, &$pageNav)
    {
        global $rsgOption;
        $option = JRequest::getCmd('option');
        $my =& JFactory::getUser();
        JHTML::_("behavior.mootools");
        //Create 'lookup array' to find whether or not galleries with the same parent
        // can move up/down in their order: $orderLookup[id parent][#] = id child
        $orderLookup = array();
        foreach ($rows as $row) {
            $orderLookup[$row->parent][] = $row->id;
        }
        ?>
        <form action="index.php" method="post" name="adminForm">
        <table border="0" width="100%">
        <tr>
            <td width="50%">
            &nbsp;
            </td>
            <td nowrap="true" width="50%" align="right">
            <?php 
        echo JText::_('Max Levels');
        ?>
            <?php 
        echo $lists['levellist'];
        ?>
            <?php 
        echo JText::_('Filter');
        ?>
:
            <input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="text_area" onChange="document.adminForm.submit();" />
            </td>
        </tr>
        </table>

        <table class="adminlist">
        <thead>
        <tr>
            <th width="1%">
            ID
            </th>
            <th width="1%">
            <input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
            </th>
            <th class="Name">
            <?php 
        echo JText::_('Name');
        ?>
            </th>
            <th width="5%">
            <?php 
        echo JText::_('Published');
        ?>
            </th>
            <th colspan="2" width="5%">
            <?php 
        echo JText::_('Reorder');
        ?>
            </th>
			<th width="2%">
				<?php 
        echo JText::_('Order');
        ?>
			</th>
			<th width="2%">
				<?php 
        echo JHtml::_('grid.order', $rows);
        ?>
			</th>
			<th width="4%"><?php 
        echo JText::_('Items');
        ?>
</th>
            <th width="25%">
            <?php 
        echo JText::_('Hits');
        ?>
            </th>
        </tr>
        </thead>
        <tbody>
        <?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $link = "index2.php?option={$option}&rsgOption={$rsgOption}&task=editA&hidemainmenu=1&id=" . $row->id;
            $task = $row->published ? 'unpublish' : 'publish';
            $img = $row->published ? 'publish_g.png' : 'publish_x.png';
            $alt = $row->published ? 'Published' : 'Unpublished';
            $checked = JHTML::_('grid.checkedout', $row, $i);
            //Use the $orderLookup array to determine if for the same
            // parent one can still move up/down. First look up the parent info.
            $orderkey = array_search($row->id, $orderLookup[$row->parent]);
            $showMoveUpIcon = isset($orderLookup[$row->parent][$orderkey - 1]);
            $showMoveDownIcon = isset($orderLookup[$row->parent][$orderkey + 1]);
            ?>
            <tr class="<?php 
            echo "row{$k}";
            ?>
">
                <td>
                <?php 
            echo $row->id;
            ?>
                </td>
                <td>
                <?php 
            echo $checked;
            ?>
                </td>
                <td>
                <?php 
            if ($row->checked_out && $row->checked_out != $my->id) {
                echo stripslashes($row->name);
            } else {
                ?>
                    <a href="<?php 
                echo $link;
                ?>
" name="Edit Gallery">
                    <?php 
                echo stripslashes($row->treename);
                ?>
                    </a>
                    <?php 
            }
            ?>
				<a href="<?php 
            echo JRoute::_('index.php?option=com_rsgallery2&rsgOption=images&gallery_id=' . $row->id);
            ?>
" >
					<img src="images/forward_f2.png" width="12" height="12" style="margin: 0px 20px" alt="<?php 
            echo JText::_('ITEMS');
            ?>
" />
				</a>				
                </td>
                <td align="center">
                <a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task;
            ?>
')">
                <img src="images/<?php 
            echo $img;
            ?>
" width="12" height="12"  alt="<?php 
            echo $alt;
            ?>
" />
                </a>
                </td>
                <td>
					<?php 
            echo $pageNav->orderUpIcon($i, $showMoveUpIcon);
            ?>
                </td>
                <td>
					<?php 
            echo $pageNav->orderDownIcon($i, $n, $showMoveDownIcon);
            ?>
                </td>
                <td colspan="2" align="center">
                <input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" class="text_area" style="text-align: center" />
                </td>
                <td align="center">
                <?php 
            $gallery = rsgGalleryManager::get($row->id);
            echo $gallery->itemCount();
            ?>
                </td>
                <td align="left">
                <?php 
            echo $row->hits;
            ?>
                </td>
            </tr>
            <?php 
            $k = 1 - $k;
        }
        ?>
        </tbody>
        <tfoot>
        <tr>
        	<td colspan="10"><?php 
        echo $pageNav->getListFooter();
        ?>
</td>
        </tr>
        </tfoot>
        </table>
        
        <input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
        <input type="hidden" name="rsgOption" value="<?php 
        echo $rsgOption;
        ?>
" />
        <input type="hidden" name="task" value="" />
        <input type="hidden" name="boxchecked" value="0" />
        <input type="hidden" name="hidemainmenu" value="0" />
        </form>
        <?php 
    }
Exemplo n.º 9
0
 /**
  * Shows the voting screen
  */
 function _showVotes()
 {
     global $mainframe, $rsgConfig, $rsgAccess;
     $gallery = rsgGalleryManager::get();
     $vote_view = $rsgConfig->get('voting') && ($rsgAccess->checkGallery("vote_view", $gallery->id) || $rsgAccess->checkGallery("vote_vote", $gallery->id));
     if ($vote_view) {
         $css = "<link rel=\"stylesheet\" href=\"" . JURI_SITE . "/components/com_rsgallery2/lib/rsgvoting/rsgvoting.css\" type=\"text/css\" />";
         $mainframe->addCustomHeadTag($css);
         $voting = new rsgVoting();
         if ($rsgAccess->checkGallery("vote_view", $gallery->id)) {
             $voting->showScore();
         }
         if ($rsgAccess->checkGallery("vote_vote", $gallery->id)) {
             $voting->showVoting();
         }
     } else {
         echo JText::_('Voting is disabled!');
     }
 }
Exemplo n.º 10
0
 /**
 		@deprecated Use rsgGallery->getItem() instead!
 	**/
 function getItem($id = null)
 {
     $gallery = rsgGalleryManager::get();
     return $gallery->getItem($id);
 }
Exemplo n.º 11
0
 /**
  * Shows details of image
  */
 function showDisplayImageDetails()
 {
     global $rsgConfig, $rsgAccess;
     $gallery = rsgGalleryManager::get();
     // if no details need to be displayed then exit
     if (!($rsgConfig->get("displayDesc") || $rsgConfig->get("displayVoting") || $rsgConfig->get("displayComments") || $rsgConfig->get("displayEXIF"))) {
         return;
     }
     jimport("joomla.html.pane");
     $tabs =& JPane::getInstance("Tabs", array("useCookies" => true));
     echo $tabs->startPane('tabs');
     if ($rsgConfig->get("displayDesc")) {
         echo $tabs->startPanel(JText::_('Description'), 'rs-description');
         $this->_showDescription();
         echo $tabs->endPanel();
     }
     if ($rsgConfig->get("displayVoting")) {
         echo $tabs->startPanel(JText::_('Voting'), 'Voting');
         $this->_showVotes();
         echo $tabs->endPanel();
     }
     if ($rsgConfig->get("displayComments")) {
         echo $tabs->startPanel(JText::_('Comments'), 'Comments');
         $this->_showComments();
         echo $tabs->endPanel();
     }
     if ($rsgConfig->get("displayEXIF")) {
         echo $tabs->startPanel(JText::_('EXIF'), 'EXIF');
         $this->_showEXIF();
         echo $tabs->endPanel();
     }
     echo $tabs->endPanel();
 }