Exemplo n.º 1
0
    /**
     * Display all available Visualizations
     * @param array array of objects
     * @param object page navigation
     * @param array lists
     */
    function show($visualizations, $pageNav, $lists)
    {
        FabrikViewVisualization::setVisualizationsToolbar();
        $user =& JFactory::getUser();
        $n = count($visualizations);
        ?>

		<form action="index.php" method="post" name="adminForm">
		<?php 
        echo $lists['vizualizations'];
        ?>
			<table class="adminlist">
				<thead>
				<tr>
					<th width="2%"><?php 
        echo JHTML::_('grid.sort', '#', 'id', @$lists['order_Dir'], @$lists['order']);
        ?>
</th>
					<th width="1%">
						<input type="checkbox" id="toggle" name="toggle" value="" onclick="checkAll(<?php 
        echo $n;
        ?>
);" />
					</th>
					<th width="40%"><?php 
        echo JText::_('LABEL');
        ?>
</th>
					<th width="45%"><?php 
        echo JText::_('TYPE');
        ?>
</th>
					<th width="3%"><?php 
        echo JText::_('PUBLISHED');
        ?>
</th>
				</tr>
				</thead>
				<tfoot>
					<tr>
						<td colspan="5">
						<?php 
        echo $pageNav->getListFooter();
        ?>
					</td>
					</tr>
				</tfoot>
				<tbody>
				<?php 
        $k = 0;
        for ($i = 0; $i < $n; $i++) {
            $row =& $visualizations[$i];
            $checked = JHTML::_('grid.checkedout', $row, $i);
            $link = JRoute::_('index.php?option=com_fabrik&c=visualization&task=edit&cid=' . $row->id);
            $row->published = $row->state;
            $published = JHTML::_('grid.published', $row, $i);
            ?>
					<tr class="<?php 
            echo "row{$k}";
            ?>
">
						<td width="1%"><?php 
            echo $row->id;
            ?>
</td>
						<td width="1%"><?php 
            echo $checked;
            ?>
</td>
						<td width="29%"><?php 
            if ($row->checked_out && $row->checked_out != $user->get('id')) {
                echo $row->label;
            } else {
                ?>
 <a href="<?php 
                echo $link;
                ?>
"><?php 
                echo $row->label;
                ?>
</a> <?php 
            }
            ?>
						</td>
						<td>
							<?php 
            echo $row->plugin;
            ?>
						</td>
						<td>
							<?php 
            echo $published;
            ?>
						</td>

					</tr>
					<?php 
            $k = 1 - $k;
        }
        ?>
				</tbody>
			</table>
			<input type="hidden" name="option" value="com_fabrik" />
			<input type="hidden" name="c" value="visualization" />
			<input type="hidden" name="boxchecked" value="0" />
			<input type="hidden" name="task" value="visualization" />
			<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
	<?php 
    }
Exemplo n.º 2
0
 /**
  * Display the list of Visualizations
  */
 function display()
 {
     $app =& JFactory::getApplication();
     $db =& JFactory::getDBO();
     $context = 'com_fabrik.vizualization.list.';
     $filter_plugin = $app->getUserStateFromRequest($context . "filter_plugin", 'filter_plugin', '');
     //get active vizulalization plugins
     $pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel');
     $pluginManager->_group = 'visualization';
     $pluginManager->loadPlugInGroup('visualization');
     $lists['vizualizations'] = $pluginManager->getElementTypeDd($filter_plugin, 'filter_plugin', 'class="inputbox"  onchange="document.adminForm.submit();"', '- ' . JText::_('SELECT PLUGIN TYPE') . ' -');
     $where = $filter_plugin == '' ? '' : ' WHERE plugin = "' . $filter_plugin . '"';
     // get the total number of records
     $db->setQuery("SELECT count(*) FROM #__fabrik_visualizations {$where}");
     $total = $db->loadResult();
     echo $db->getErrorMsg();
     $limit = $app->getUserStateFromRequest($context . 'limit', 'limit', $app->getCfg('list_limit'), 'int');
     $limitstart = $app->getUserStateFromRequest($context . 'limitstart', 'limitstart', 0, 'int');
     $sql = "SELECT * FROM #__fabrik_visualizations {$where}";
     $db->setQuery($sql, $limitstart, $limit);
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     $rows = $db->loadObjectList();
     require_once JPATH_COMPONENT . DS . 'views' . DS . 'visualization.php';
     FabrikViewVisualization::show($rows, $pageNav, $lists);
 }