Esempio n. 1
0
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    function showList(&$rows, $search, $pageNav, $option)
    {
        global $my, $adminLanguage;
        global $mosConfig_live_site;
        ?>
		<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
		<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th class="frontpage">
			<?php 
        echo $adminLanguage->A_COMP_FRONT_PAGE_ITEMS;
        ?>
			</th>
			<td>
			<?php 
        echo $adminLanguage->A_COMP_FILTER;
        ?>
:
			</td>
			<td> 
			<input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="inputbox" onChange="document.adminForm.submit();" />
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="20"> 
			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title" width="50%">
			<?php 
        echo $adminLanguage->A_COMP_TITLE;
        ?>
			</th>
			<th width="10%" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_PUBLISHED;
        ?>
			</th>
			<th colspan="2" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_REORDER;
        ?>
			</th>
			<th width="10%" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_ACCESS;
        ?>
			</th>
			<th width="15%" align="left">
			<?php 
        echo $adminLanguage->A_COMP_CATEG;
        ?>
			</th>
			<th>
			<?php 
        echo $adminLanguage->A_COMP_FRONT_ORDER;
        ?>
			</th>
			<th width="10%" nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_CHECKED_OUT;
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td width="20">
				<?php 
            echo mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id);
            ?>
				</td>
				<td>
				<?php 
            echo $row->title;
            ?>
 
				</td>
				<?php 
            $now = date("Y-m-d h:i:s");
            if ($now <= $row->publish_up && $row->state == "1") {
                $img = 'publish_y.png';
                $alt = $adminLanguage->A_COMP_PUBLISHED;
            } else {
                if (($now <= $row->publish_down || $row->publish_down == "0000-00-00 00:00:00") && $row->state == "1") {
                    $img = 'publish_g.png';
                    $alt = $adminLanguage->A_COMP_PUBLISHED;
                } else {
                    if ($now > $row->publish_down && $row->state == "1") {
                        $img = 'publish_r.png';
                        $alt = $adminLanguage->A_COMP_EXPIRED;
                    } elseif ($row->state == "0") {
                        $img = "publish_x.png";
                        $alt = $adminLanguage->A_COMP_UNPUBLISHED;
                    }
                }
            }
            $times = '';
            if (isset($row->publish_up)) {
                if ($row->publish_up == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_START_ALWAYS . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_START . ": " . $row->publish_up . "</td></tr>";
                }
            }
            if (isset($row->publish_down)) {
                if ($row->publish_down == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_FIN_NOEXP . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_FINISH . ": " . $row->publish_down . "</td></tr>";
                }
            }
            if ($times) {
                ?>
					<td align="center">
					<a href="javascript: void(0);" onmouseover="return overlib('<table><?php 
                echo $times;
                ?>
</table>', CAPTION, 'Publish Information', BELOW, RIGHT);" onMouseOut="return nd();" onclick="return listItemTask('cb<?php 
                echo $i;
                ?>
','<?php 
                echo $row->state ? "unpublish" : "publish";
                ?>
')">
					<img src="images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
					</a>
					</td>
					<?php 
            }
            ?>
				<td>
				<?php 
            echo $pageNav->orderUpIcon($i);
            ?>
				</td>
				<td>
				<?php 
            echo $pageNav->orderDownIcon($i, $n);
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->groupname;
            ?>
				</td>
				<td>
				<?php 
            echo $row->name;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->fpordering;
            ?>
				</td>
				<?php 
            if ($row->checked_out) {
                ?>
					<td align="center">
					<?php 
                echo $row->editor;
                ?>
					</td>
					<?php 
            } else {
                ?>
					<td align="center">&nbsp;</td>
					<?php 
            }
            ?>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		</form>
		<br />
	
		<?php 
        mosCommonHTML::ContentLegend();
        ?>
		<script language="Javascript" src="<?php 
        echo $mosConfig_live_site;
        ?>
/includes/js/overlib_mini.js"></script>
		<?php 
    }
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    function showContent(&$rows, $section, &$lists, $search, $pageNav, $all = NULL, $redirect)
    {
        global $my, $acl, $database, $mosConfig_offset;
        mosCommonHTML::loadOverlib();
        ?>
		<form action="index2.php?option=com_content" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="edit" rowspan="2" nowrap="nowrap">
			<?php 
        if ($all) {
            ?>
				Administrar Itens de Conteúdo  <small><small>[ Seção: Todas ]</small></small>
				<?php 
        } else {
            ?>
				Administrar Itens de Conteúdo <small><small>[ Seção: <?php 
            echo $section->title;
            ?>
 ]</small></small>
				<?php 
        }
        ?>
			</th>
			<?php 
        if ($all) {
            ?>
				<td align="right" rowspan="2" valign="top">
				<?php 
            echo $lists['sectionid'];
            ?>
				</td>
				<?php 
        }
        ?>
			<td align="right" valign="top">
			<?php 
        echo $lists['catid'];
        ?>
			</td>
			<td valign="top">
			<?php 
        echo $lists['authorid'];
        ?>
			</td>
		</tr>
		<tr>
			<td align="right">
			Filtro:
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo htmlspecialchars($search);
        ?>
" class="text_area" onChange="document.adminForm.submit();" />
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="5">
			nº
			</th>
			<th width="5">
			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title">
			Título
			</th>
			<th width="5%">
			Publicado
			</th>
			<th nowrap="nowrap" width="5%">
			Página Inicial
			</th>
			<th colspan="2" align="center" width="5%">
			Reordenar
			</th>
			<th width="2%">
			Ordem
			</th>
			<th width="1%">
			<a href="javascript: saveorder( <?php 
        echo count($rows) - 1;
        ?>
 )"><img src="images/filesave.png" border="0" width="16" height="16" alt="Salvar Ordem" /></a>
			</th>
			<th >
			Acesso 
			</th>
			<th width="2%">
			ID
			</th>
			<?php 
        if ($all) {
            ?>
				<th align="left">
				Seção
				</th>
				<?php 
        }
        ?>
			<th align="left">
			Categoria 
			</th>
			<th align="left">
			Autor
			</th>
			<th align="center" width="10">
			Data
			</th>
		  </tr>
		<?php 
        $k = 0;
        $nullDate = $database->getNullDate();
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            mosMakeHtmlSafe($row);
            $link = 'index2.php?option=com_content&sectionid=' . $redirect . '&task=edit&hidemainmenu=1&id=' . $row->id;
            $row->sect_link = 'index2.php?option=com_sections&task=editA&hidemainmenu=1&id=' . $row->sectionid;
            $row->cat_link = 'index2.php?option=com_categories&task=editA&hidemainmenu=1&id=' . $row->catid;
            $now = _CURRENT_SERVER_TIME;
            if ($now <= $row->publish_up && $row->state == 1) {
                // Published
                $img = 'publish_y.png';
                $alt = 'Publicado';
            } else {
                if (($now <= $row->publish_down || $row->publish_down == $nullDate) && $row->state == 1) {
                    // Pending
                    $img = 'publish_g.png';
                    $alt = 'Publicado';
                } else {
                    if ($now > $row->publish_down && $row->state == 1) {
                        // Expired
                        $img = 'publish_r.png';
                        $alt = 'Expirado';
                    } elseif ($row->state == 0) {
                        // Unpublished
                        $img = 'publish_x.png';
                        $alt = 'Despublicado';
                    }
                }
            }
            // correct times to include server offset info
            $row->publish_up = mosFormatDate($row->publish_up, _CURRENT_SERVER_TIME_FORMAT);
            if (trim($row->publish_down) == $nullDate || trim($row->publish_down) == '' || trim($row->publish_down) == '-') {
                $row->publish_down = 'Nunca';
            }
            $row->publish_down = mosFormatDate($row->publish_down, _CURRENT_SERVER_TIME_FORMAT);
            $times = '';
            if ($row->publish_up == $nullDate) {
                $times .= "<tr><td>Início: Sempre</td></tr>";
            } else {
                $times .= "<tr><td>Início: {$row->publish_up}</td></tr>";
            }
            if ($row->publish_down == $nullDate || $row->publish_down == 'Nunca') {
                $times .= "<tr><td>Fim: Não Expira</td></tr>";
            } else {
                $times .= "<tr><td>Final: {$row->publish_down}</td></tr>";
            }
            if ($acl->acl_check('administration', 'manage', 'users', $my->usertype, 'components', 'com_users')) {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id=' . $row->created_by;
                    $author = '<a href="' . $linkA . '" title="Editar Usuário">' . $row->author . '</a>';
                }
            } else {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $author = $row->author;
                }
            }
            $date = mosFormatDate($row->created, '%x');
            $access = mosCommonHTML::AccessProcessing($row, $i);
            $checked = mosCommonHTML::CheckedOutProcessing($row, $i);
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo $pageNav->rowNumber($i);
            ?>
				</td>
				<td align="center">
				<?php 
            echo $checked;
            ?>
				</td>
				<td>
				<?php 
            if ($row->checked_out && $row->checked_out != $my->id) {
                echo $row->title;
            } else {
                ?>
					<a href="<?php 
                echo $link;
                ?>
" title="Editar Conteúdo">
					<?php 
                echo $row->title;
                ?>
					</a>
					<?php 
            }
            ?>
				</td>
				<?php 
            if ($times) {
                ?>
					<td align="center">
					<a href="javascript: void(0);" onMouseOver="return overlib('<table><?php 
                echo $times;
                ?>
</table>', CAPTION, 'Informação da Publicação', BELOW, RIGHT);" onMouseOut="return nd();" onclick="return listItemTask('cb<?php 
                echo $i;
                ?>
','<?php 
                echo $row->state ? "unpublish" : "publish";
                ?>
')">
					<img src="images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
					</a>
					</td>
					<?php 
            }
            ?>
				<td align="center">
				<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','toggle_frontpage')">
				<img src="images/<?php 
            echo $row->frontpage ? 'tick.png' : 'publish_x.png';
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $row->frontpage ? 'Sim' : 'Não';
            ?>
" />
				</a>
				</td>
				<td align="right">
				<?php 
            echo $pageNav->orderUpIcon($i, $row->catid == @$rows[$i - 1]->catid);
            ?>
				</td>
				<td align="left">
				<?php 
            echo $pageNav->orderDownIcon($i, $n, $row->catid == @$rows[$i + 1]->catid);
            ?>
				</td>
				<td align="center" colspan="2">
				<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" class="text_area" style="text-align: center" />
				</td>
				<td align="center">
				<?php 
            echo $access;
            ?>
				</td>
				<td align="left">
				<?php 
            echo $row->id;
            ?>
				</td>
				<?php 
            if ($all) {
                ?>
					<td align="left">
					<a href="<?php 
                echo $row->sect_link;
                ?>
" title="Editar Seção">
					<?php 
                echo $row->section_name;
                ?>
					</a>
					</td>
					<?php 
            }
            ?>
				<td align="left">
				<a href="<?php 
            echo $row->cat_link;
            ?>
" title="Editar Categoria">
				<?php 
            echo $row->name;
            ?>
				</a>
				</td>
				<td align="left">
				<?php 
            echo $author;
            ?>
				</td>
				<td align="left">
				<?php 
            echo $date;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>

		<?php 
        echo $pageNav->getListFooter();
        ?>
		<?php 
        mosCommonHTML::ContentLegend();
        ?>

		<input type="hidden" name="option" value="com_content" />
		<input type="hidden" name="sectionid" value="<?php 
        echo $section->id;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		<input type="hidden" name="redirect" value="<?php 
        echo $redirect;
        ?>
" />
		<input type="hidden" name="<?php 
        echo josSpoofValue();
        ?>
" value="1" />
		</form>
		<?php 
    }
Esempio n. 3
0
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    function showContent(&$rows, $section, &$lists, $search, $pageNav, $all = NULL, $redirect)
    {
        global $my, $acl;
        mosCommonHTML::loadOverlib();
        ?>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="edit" rowspan="2" nowrap>
			<?php 
        if ($all) {
            ?>
				<?php 
            echo T_('Content Items Manager');
            ?>
 <small><small>[ <?php 
            echo T_('Section: All');
            ?>
 ]</small></small>
				<?php 
        } else {
            ?>
				<?php 
            echo T_('Content Items Manager');
            ?>
 <small><small>[ <?php 
            echo T_('Section:');
            ?>
 <?php 
            echo $section->title;
            ?>
 ]</small></small>
				<?php 
        }
        ?>
			</th>
			<?php 
        if ($all) {
            ?>
				<td width="right" rowspan="2" valign="top">
				<?php 
            echo $lists['sectionid'];
            ?>
				</td>
				<?php 
        }
        ?>
			<td width="right" valign="top">
			<?php 
        echo $lists['catid'];
        ?>
			</td>
			<td width="right" valign="top">
			<?php 
        echo $lists['authorid'];
        ?>
			</td>
		</tr>
		<tr>
			<td align="right">
			<?php 
        echo T_('Filter:');
        ?>
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="text_area" onChange="document.adminForm.submit();" />
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="5">
			#
			</th>
			<th width="5">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title">
			<?php 
        echo T_('Title');
        ?>
			</th>
			<th width="5%">
			<?php 
        echo T_('Published');
        ?>
			</th>
			<th nowrap="nowrap" width="5%">
			<?php 
        echo T_('Front Page');
        ?>
			</th>
			<th colspan="2" align="center" width="5%">
			<?php 
        echo T_('Reorder');
        ?>
			</th>
			<th width="2%">
			<?php 
        echo T_('Order');
        ?>
			</th>
			<th width="1%">
			<a href="javascript: saveorder( <?php 
        echo count($rows) - 1;
        ?>
 )"><img src="images/filesave.png" border="0" width="16" height="16" alt="<?php 
        echo T_('Save Order');
        ?>
" /></a>
			</th>
			<th >
			<?php 
        echo T_('Access');
        ?>
			</th>
			<th width="2%">
			<?php 
        echo T_('ID');
        ?>
			</th>
			<?php 
        if ($all) {
            ?>
				<th align="left">
				<?php 
            echo T_('Section');
            ?>
				</th>
				<?php 
        }
        ?>
			<th align="left">
			<?php 
        echo T_('Category');
        ?>
			</th>
			<th align="left">
			<?php 
        echo T_('Author');
        ?>
			</th>
			<th align="center" width="10">
			<?php 
        echo T_('Date');
        ?>
			</th>
		  </tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $link = 'index2.php?option=com_content&sectionid=' . $redirect . '&task=edit&hidemainmenu=1&id=' . $row->id;
            $row->sect_link = 'index2.php?option=com_sections&task=editA&hidemainmenu=1&id=' . $row->sectionid;
            $row->cat_link = 'index2.php?option=com_categories&task=editA&hidemainmenu=1&id=' . $row->catid;
            $now = date("Y-m-d H:i:s");
            if ($now <= $row->publish_up && $row->state == "1") {
                $img = 'publish_y.png';
                $alt = T_('Published');
            } else {
                if (($now <= $row->publish_down || $row->publish_down == "0000-00-00 00:00:00") && $row->state == "1") {
                    $img = 'publish_g.png';
                    $alt = T_('Published');
                } else {
                    if ($now > $row->publish_down && $row->state == "1") {
                        $img = 'publish_r.png';
                        $alt = T_('Expired');
                    } elseif ($row->state == "0") {
                        $img = "publish_x.png";
                        $alt = T_('Unpublished');
                    }
                }
            }
            $times = '';
            if (isset($row->publish_up)) {
                if ($row->publish_up == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . T_('Start:') . " " . T_('Always') . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . T_('Start:') . " {$row->publish_up}</td></tr>";
                }
            }
            if (isset($row->publish_down)) {
                if ($row->publish_down == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . T_('Finish:') . " " . T_('No Expiry') . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . T_('Finish:') . " {$row->publish_down}</td></tr>";
                }
            }
            if ($acl->acl_check('administration', 'manage', 'users', $my->usertype, 'components', 'com_users')) {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id=' . $row->created_by;
                    $author = '<a href="' . $linkA . '" title="' . T_('Edit User') . '">' . $row->author . '</a>';
                }
            } else {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $author = $row->author;
                }
            }
            $date = mosFormatDate($row->created, '%x');
            $access = mosCommonHTML::AccessProcessing($row, $i);
            $checked = mosCommonHTML::CheckedOutProcessing($row, $i);
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo $pageNav->rowNumber($i);
            ?>
				</td>
				<td align="center">
				<?php 
            echo $checked;
            ?>
				</td>
				<td>
				<?php 
            if ($row->checked_out && $row->checked_out != $my->id) {
                echo $row->title;
            } else {
                ?>
					<a href="<?php 
                echo $link;
                ?>
" title="<?php 
                echo T_('Edit Content');
                ?>
">
					<?php 
                echo htmlspecialchars($row->title, ENT_QUOTES);
                ?>
					</a>
					<?php 
            }
            ?>
				</td>
				<?php 
            if ($times) {
                ?>
					<td align="center">
					<a href="javascript: void(0);" onMouseOver="return overlib('<table><?php 
                echo $times;
                ?>
</table>', CAPTION, '<?php 
                echo T_('Publish Information');
                ?>
', BELOW, RIGHT);" onMouseOut="return nd();" onClick="return listItemTask('cb<?php 
                echo $i;
                ?>
','<?php 
                echo $row->state ? "unpublish" : "publish";
                ?>
')">
					<img src="images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
					</a>
					</td>
					<?php 
            }
            ?>
				<td align="center">
				<a href="javascript: void(0);" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','toggle_frontpage')">
				<img src="images/<?php 
            echo $row->frontpage ? 'tick.png' : 'publish_x.png';
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $row->frontpage ? T_('Yes') : T_('No');
            ?>
" />
				</a>
				</td>
				<td align="right">
				<?php 
            echo $pageNav->orderUpIcon($i, $row->catid == @$rows[$i - 1]->catid);
            ?>
				</td>
				<td align="left">
				<?php 
            echo $pageNav->orderDownIcon($i, $n, $row->catid == @$rows[$i + 1]->catid);
            ?>
				</td>
				<td align="center" colspan="2">
				<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" class="text_area" style="text-align: center" />
				</td>
				<td align="center">
				<?php 
            echo $access;
            ?>
				</td>
				<td align="left">
				<?php 
            echo $row->id;
            ?>
				</td>
				<?php 
            if ($all) {
                ?>
					<td align="left">
					<a href="<?php 
                echo $row->sect_link;
                ?>
" title="<?php 
                echo T_('Edit Section');
                ?>
">
					<?php 
                echo $row->section_name;
                ?>
					</a>
					</td>
					<?php 
            }
            ?>
				<td align="left">
				<a href="<?php 
            echo $row->cat_link;
            ?>
" title="<?php 
            echo T_('Edit Category');
            ?>
">
				<?php 
            echo $row->name;
            ?>
				</a>
				</td>
				<td align="left">
				<?php 
            echo $author;
            ?>
				</td>
				<td align="left">
				<?php 
            echo $date;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>

		<?php 
        echo $pageNav->getListFooter();
        ?>
		<?php 
        mosCommonHTML::ContentLegend();
        ?>

		<input type="hidden" name="option" value="com_content" />
		<input type="hidden" name="sectionid" value="<?php 
        echo $section->id;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		<input type="hidden" name="redirect" value="<?php 
        echo $redirect;
        ?>
" />
		</form>
		<?php 
    }
Esempio n. 4
0
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    function showContent(&$rows, $section, &$lists, $search, $pageNav, $option, $all = NULL, $redirect)
    {
        global $my, $mosConfig_live_site, $adminLanguage;
        ?>
		<div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<?php 
        if ($all) {
            ?>
				<th class="edit">
				<?php 
            echo $adminLanguage->A_COMP_CONTENT_ALL_ITEMS;
            ?>
				</th>
				<?php 
        } else {
            ?>
				<th class="edit">
				<?php 
            echo $section->title;
            echo $adminLanguage->A_COMP_ITEMS;
            ?>
				</th>
				<?php 
        }
        ?>
			<td>
			<?php 
        echo $adminLanguage->A_COMP_FILTER;
        ?>
:
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="text_area" onChange="document.adminForm.submit();" />
			</td>
			<?php 
        if ($all) {
            ?>
				<td width="right">
				<?php 
            echo $lists['sectionid'];
            ?>
				</td>
				<?php 
        }
        ?>
			<td width="right">
			<?php 
        echo $lists['catid'];
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="5">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title" width="30%">
			<?php 
        echo $adminLanguage->A_COMP_TITLE;
        ?>
			</th>
			<th width="5%">
			<?php 
        echo $adminLanguage->A_COMP_PUBLISHED;
        ?>
			</th>
			<th nowrap="nowrap" width="5%">
			<?php 
        echo $adminLanguage->A_COMP_FRONT_PAGE;
        ?>
			</th>
			<th colspan="2" align="center" width="5%">
			<?php 
        echo $adminLanguage->A_COMP_REORDER;
        ?>
			</th>
			<th width="10%">
			<?php 
        echo $adminLanguage->A_COMP_ACCESS;
        ?>
			</th>
			<th width="2%">
			<?php 
        echo $adminLanguage->A_COMP_ID;
        ?>
			</th>
			<?php 
        if ($all) {
            ?>
				<th align="left">
				<?php 
            echo $adminLanguage->A_COMP_SECTION;
            ?>
				</th>
				<?php 
        }
        ?>
			<th align="left">
			<?php 
        echo $adminLanguage->A_COMP_CATEG;
        ?>
			</th>
			<th nowrap="nowrap">
			<?php 
        echo $adminLanguage->A_COMP_CHECKED_OUT;
        ?>
			</th>
		  </tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            if (!$row->access) {
                $color_access = 'style="color: green;"';
                $task_access = 'accessregistered';
            } else {
                if ($row->access == 1) {
                    $color_access = 'style="color: red;"';
                    $task_access = 'accessspecial';
                } else {
                    $color_access = 'style="color: black;"';
                    $task_access = 'accesspublic';
                }
            }
            $link = 'index2.php?option=com_content&sectionid=' . $redirect . '&task=edit&id=' . $row->id;
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id);
            ?>
				</td>
				<td>
				<?php 
            if ($row->checked_out && $row->checked_out != $my->id) {
                echo $row->title;
                ?>
 [ <i><?php 
                echo $adminLanguage->A_COMP_CHECKED_OUT;
                ?>
</i> ]
					<?php 
            } else {
                ?>
					<a href="<?php 
                echo $link;
                ?>
">
					<?php 
                echo $row->title;
                ?>
					</a>
					<?php 
            }
            ?>
				</td>
				<?php 
            $now = date("Y-m-d h:i:s");
            if ($now <= $row->publish_up && $row->state == "1") {
                $img = 'publish_y.png';
                $alt = $adminLanguage->A_COMP_PUBLISHED;
            } else {
                if (($now <= $row->publish_down || $row->publish_down == "0000-00-00 00:00:00") && $row->state == "1") {
                    $img = 'publish_g.png';
                    $alt = $adminLanguage->A_COMP_PUBLISHED;
                } else {
                    if ($now > $row->publish_down && $row->state == "1") {
                        $img = 'publish_r.png';
                        $alt = $adminLanguage->A_COMP_EXPIRED;
                    } elseif ($row->state == "0") {
                        $img = "publish_x.png";
                        $alt = $adminLanguage->A_COMP_UNPUBLISHED;
                    }
                }
            }
            $times = '';
            if (isset($row->publish_up)) {
                if ($row->publish_up == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_START_ALWAYS . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_START . ": " . $row->publish_up . "</td></tr>";
                }
            }
            if (isset($row->publish_down)) {
                if ($row->publish_down == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_FIN_NOEXP . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . $adminLanguage->A_COMP_CONTENT_FINISH . ": " . $row->publish_down . "</td></tr>";
                }
            }
            if ($times) {
                ?>
					<td align="center">
					<a href="javascript: void(0);" onMouseOver="return overlib('<table><?php 
                echo $times;
                ?>
</table>', CAPTION, '<?php 
                echo $adminLanguage->A_COMP_CONTENT_PUBLISH_INFO;
                ?>
', BELOW, RIGHT);" onMouseOut="return nd();" onClick="return listItemTask('cb<?php 
                echo $i;
                ?>
','<?php 
                echo $row->state ? "unpublish" : "publish";
                ?>
')">
					<img src="images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
					</a>
					</td>
					<?php 
            }
            ?>
				<td align="center">
				<a href="javascript: void(0);" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','toggle_frontpage')">
				<img src="images/<?php 
            echo $row->frontpage ? 'tick.png' : 'publish_x.png';
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $row->frontpage ? $adminLanguage->A_COMP_YES : $adminLanguage->A_COMP_NO;
            ?>
" />
				</a>
				</td>
				<td align="right">
				<?php 
            echo $pageNav->orderUpIcon($i, $row->catid == @$rows[$i - 1]->catid);
            ?>
				</td>
				<td align="left">
				<?php 
            echo $pageNav->orderDownIcon($i, $n, $row->catid == @$rows[$i + 1]->catid);
            ?>
				</td>
				<td align="center">
				<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task_access;
            ?>
')" <?php 
            echo $color_access;
            ?>
>
				<?php 
            echo $row->groupname;
            ?>
				</a>
				</td>
				<td align="left">
				<?php 
            echo $row->id;
            ?>
				</td>
				<?php 
            if ($all) {
                ?>
					<td align="left">
					<?php 
                echo $row->section_name;
                ?>
					</td>
					<?php 
            }
            ?>
				<td align="left">
				<?php 
            echo $row->name;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->checked_out ? $row->editor : "";
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>
		<?php 
        echo $pageNav->getListFooter();
        ?>
		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="sectionid" value="<?php 
        echo $section->id;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="redirect" value="<?php 
        echo $redirect;
        ?>
" />
		</form>
		<br />

		<?php 
        mosCommonHTML::ContentLegend();
        ?>
		<script language="Javascript" src="<?php 
        echo $mosConfig_live_site;
        ?>
/includes/js/overlib_mini.js"></script>
		<?php 
    }
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    function showContent(&$rows, &$pageNav, $option, $search, &$lists)
    {
        global $my, $acl;
        mosCommonHTML::loadOverlib();
        ?>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="edit">
			<?php 
        echo T_('Static Content Manager');
        ?>
			</th>
			<td>
			<?php 
        echo T_('Filter:');
        ?>
&nbsp;
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo $search;
        ?>
" class="text_area" onChange="document.adminForm.submit();" />
			</td>
			<td>
			&nbsp;&nbsp;&nbsp;<?php 
        echo T_('Order:');
        ?>
&nbsp;
			</td>
			<td>
			<?php 
        echo $lists['order'];
        ?>
			</td>
			<td width="right">
			<?php 
        echo $lists['authorid'];
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="5">
			#
			</th>
			<th width="5px">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title">
			<?php 
        echo T_('Title');
        ?>
			</th>
			<th width="5%">
			<?php 
        echo T_('Published');
        ?>
			</th>
			<th nowrap="nowrap" width="5%">
			<?php 
        echo T_('Front Page');
        ?>
			</th>
			<th width="2%">
			<?php 
        echo T_('Order');
        ?>
			</th>
			<th width="1%">
			<a href="javascript: saveorder( <?php 
        echo count($rows) - 1;
        ?>
 )"><img src="images/filesave.png" border="0" width="16" height="16" alt="<?php 
        echo T_('Save Order');
        ?>
" /></a>
			</th>
			<th width="10%">
			<?php 
        echo T_('Access');
        ?>
			</th>
			<th width="5%">
			<?php 
        echo T_('ID');
        ?>
			</th>
			<th width="1%" align="left">
			<?php 
        echo T_('Links');
        ?>
			</th>
			<th width="20%" align="left">
			<?php 
        echo T_('Author');
        ?>
			</th>
			<th align="center" width="10">
			<?php 
        echo T_('Date');
        ?>
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $now = date("Y-m-d H:i:s");
            if ($now <= $row->publish_up && $row->state == "1") {
                $img = 'publish_y.png';
                $alt = T_('Published');
            } else {
                if (($now <= $row->publish_down || $row->publish_down == "0000-00-00 00:00:00") && $row->state == "1") {
                    $img = 'publish_g.png';
                    $alt = T_('Published');
                } else {
                    if ($now > $row->publish_down && $row->state == "1") {
                        $img = 'publish_r.png';
                        $alt = T_('Expired');
                    } elseif ($row->state == "0") {
                        $img = "publish_x.png";
                        $alt = T_('Unpublished');
                    }
                }
            }
            $times = '';
            if (isset($row->publish_up)) {
                if ($row->publish_up == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . T_('Start:') . " " . T_('Always') . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . T_('Start:') . " {$row->publish_up}</td></tr>";
                }
            }
            if (isset($row->publish_down)) {
                if ($row->publish_down == '0000-00-00 00:00:00') {
                    $times .= "<tr><td>" . T_('Finish:') . " " . T_('No Expiry') . "</td></tr>";
                } else {
                    $times .= "<tr><td>" . T_('Finish:') . " {$row->publish_down}</td></tr>";
                }
            }
            if (!$row->access) {
                $color_access = 'style="color: green;"';
                $task_access = 'accessregistered';
            } else {
                if ($row->access == 1) {
                    $color_access = 'style="color: red;"';
                    $task_access = 'accessspecial';
                } else {
                    $color_access = 'style="color: black;"';
                    $task_access = 'accesspublic';
                }
            }
            $link = 'index2.php?option=com_typedcontent&task=edit&hidemainmenu=1&id=' . $row->id;
            if ($row->checked_out) {
                $checked = mosCommonHTML::checkedOut($row);
            } else {
                $checked = mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id);
            }
            if ($acl->acl_check('administration', 'manage', 'users', $my->usertype, 'components', 'com_users')) {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id=' . $row->created_by;
                    $author = '<a href="' . $linkA . '" title="' . T_('Edit User') . '">' . $row->creator . '</a>';
                }
            } else {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $author = $row->creator;
                }
            }
            $date = mosFormatDate($row->created, '%x');
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo $pageNav->rowNumber($i);
            ?>
				</td>
				<td>
				<?php 
            echo $checked;
            ?>
				</td>
				<td>
				<?php 
            if ($row->checked_out && $row->checked_out != $my->id) {
                echo $row->title;
                if ($row->title_alias) {
                    echo ' (<i>' . $row->title_alias . '</i>)';
                }
            } else {
                ?>
					<a href="<?php 
                echo $link;
                ?>
" title="<?php 
                echo T_('Edit Static Content');
                ?>
">
					<?php 
                echo $row->title;
                if ($row->title_alias) {
                    echo ' (<i>' . $row->title_alias . '</i>)';
                }
                ?>
					</a>
					<?php 
            }
            ?>
				</td>
				<?php 
            if ($times) {
                ?>
					<td align="center">
					<a href="javascript: void(0);" onMouseOver="return overlib('<table><?php 
                echo $times;
                ?>
</table>', CAPTION, '<?php 
                echo T_('Publish Information');
                ?>
', BELOW, RIGHT);" onMouseOut="return nd();" onClick="return listItemTask('cb<?php 
                echo $i;
                ?>
','<?php 
                echo $row->state ? "unpublish" : "publish";
                ?>
')">
					<img src="images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
					</a>
					</td>
					<?php 
            }
            ?>
				<td align="center">
				<a href="javascript: void(0);" onClick="return listItemTask('cb<?php 
            echo $i;
            ?>
','toggle_frontpage')">
				<img src="images/<?php 
            echo $row->frontpage ? 'tick.png' : 'publish_x.png';
            ?>
" width="12" height="12" border="0" alt="<?php 
            echo $row->frontpage ? T_('Yes') : T_('No');
            ?>
" />
				</a>
				</td>
				<td align="center" colspan="2">
				<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" class="text_area" style="text-align: center" />
				</td>
				<td align="center">
				<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task_access;
            ?>
')" <?php 
            echo $color_access;
            ?>
>
				<?php 
            echo $row->groupname;
            ?>
				</a>
				</td>
				<td align="center">
				<?php 
            echo $row->id;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->links;
            ?>
				</td>
				<td align="left">
				<?php 
            echo $author;
            ?>
				</td>
				<td>
				<?php 
            echo $date;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>

		<?php 
        echo $pageNav->getListFooter();
        ?>
		<?php 
        mosCommonHTML::ContentLegend();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		</form>
		<?php 
    }
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    public static function showContent(&$rows, &$pageNav, $option, $search, &$lists)
    {
        global $my, $acl, $database;
        mosCommonHTML::loadOverlib();
        ?>
		<form action="index2.php" method="post" name="adminForm">

		<table class="adminheading">
		<tr>
			<th class="edit">
			Static Content Manager
			</th>
			<td>
			Filter:&nbsp;
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo htmlspecialchars($search);
        ?>
" class="text_area" onChange="document.adminForm.submit();" />
			</td>
			<td>
			&nbsp;&nbsp;&nbsp;Order:&nbsp;
			</td>
			<td>
			<?php 
        echo $lists['order'];
        ?>
			</td>
			<td width="right">
			<?php 
        echo $lists['authorid'];
        ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="5">
			#
			</th>
			<th width="5px">
			<input type="checkbox" name="toggle" value="" onClick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title">
			Title
			</th>
			<th width="5%">
			Published
			</th>
			<th width="2%">
			Order
			</th>
			<th width="1%">
			<a href="javascript: saveorder( <?php 
        echo count($rows) - 1;
        ?>
 )"><img src="images/filesave.png" border="0" width="16" height="16" alt="Save Order" /></a>
			</th>
			<th width="10%">
			Access
			</th>
			<th width="5%">
			ID
			</th>
			<th width="1%" align="left">
			Links
			</th>
			<th width="20%" align="left">
			Author
			</th>
			<th align="center" width="10">
			Date
			</th>
		</tr>
		<?php 
        $k = 0;
        $nullDate = $database->getNullDate();
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            mosMakeHtmlSafe($row);
            $now = _CURRENT_SERVER_TIME;
            if ($now <= $row->publish_up && $row->state == 1) {
                // Published
                $img = 'publish_y.png';
                $alt = 'Published';
            } else {
                if (($now <= $row->publish_down || $row->publish_down == $nullDate) && $row->state == 1) {
                    // Pending
                    $img = 'publish_g.png';
                    $alt = 'Published';
                } else {
                    if ($now > $row->publish_down && $row->state == 1) {
                        // Expired
                        $img = 'publish_r.png';
                        $alt = 'Expired';
                    } elseif ($row->state == 0) {
                        // Unpublished
                        $img = 'publish_x.png';
                        $alt = 'Unpublished';
                    }
                }
            }
            // correct times to include server offset info
            $row->publish_up = mosFormatDate($row->publish_up, _CURRENT_SERVER_TIME_FORMAT);
            if (trim($row->publish_down) == $nullDate || trim($row->publish_down) == '' || trim($row->publish_down) == '-') {
                $row->publish_down = 'Never';
            }
            $row->publish_down = mosFormatDate($row->publish_down, _CURRENT_SERVER_TIME_FORMAT);
            $times = '';
            if ($row->publish_up == $nullDate) {
                $times .= "<tr><td>Start: Always</td></tr>";
            } else {
                $times .= "<tr><td>Start: {$row->publish_up}</td></tr>";
            }
            if ($row->publish_down == $nullDate || $row->publish_down == 'Never') {
                $times .= "<tr><td>Finish: No Expiry</td></tr>";
            } else {
                $times .= "<tr><td>Finish: {$row->publish_down}</td></tr>";
            }
            if (!$row->access) {
                $color_access = 'style="color: green;"';
                $task_access = 'accessregistered';
            } else {
                if ($row->access == 1) {
                    $color_access = 'style="color: red;"';
                    $task_access = 'accessspecial';
                } else {
                    $color_access = 'style="color: black;"';
                    $task_access = 'accesspublic';
                }
            }
            $link = 'index2.php?option=com_typedcontent&task=edit&hidemainmenu=1&id=' . $row->id;
            $checked = mosCommonHTML::CheckedOutProcessing($row, $i);
            if ($acl->acl_check('administration', 'manage', 'users', $my->usertype, 'components', 'com_users')) {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id=' . $row->created_by;
                    $author = '<a href="' . $linkA . '" title="Edit User">' . $row->creator . '</a>';
                }
            } else {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $author = $row->creator;
                }
            }
            $date = mosFormatDate($row->created, '%x');
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo $pageNav->rowNumber($i);
            ?>
				</td>
				<td>
				<?php 
            echo $checked;
            ?>
				</td>
				<td>
				<?php 
            if ($row->checked_out && $row->checked_out != $my->id) {
                echo $row->title;
                if ($row->title_alias) {
                    echo ' (<i>' . $row->title_alias . '</i>)';
                }
            } else {
                ?>
					<a href="<?php 
                echo $link;
                ?>
" title="Edit Static Content">
					<?php 
                echo $row->title;
                if ($row->title_alias) {
                    echo ' (<i>' . $row->title_alias . '</i>)';
                }
                ?>
					</a>
					<?php 
            }
            ?>
				</td>
				<?php 
            if ($times) {
                ?>
					<td align="center">
					<a href="javascript: void(0);" onMouseOver="return overlib('<table><?php 
                echo $times;
                ?>
</table>', CAPTION, 'Publish Information', BELOW, RIGHT);" onMouseOut="return nd();" onClick="return listItemTask('cb<?php 
                echo $i;
                ?>
','<?php 
                echo $row->state ? "unpublish" : "publish";
                ?>
')">
					<img src="images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
					</a>
					</td>
					<?php 
            }
            ?>
				<td align="center" colspan="2">
				<input type="text" name="order[]" size="5" value="<?php 
            echo $row->ordering;
            ?>
" class="text_area" style="text-align: center" />
				</td>
				<td align="center">
				<a href="javascript: void(0);" onclick="return listItemTask('cb<?php 
            echo $i;
            ?>
','<?php 
            echo $task_access;
            ?>
')" <?php 
            echo $color_access;
            ?>
>
				<?php 
            echo $row->groupname;
            ?>
				</a>
				</td>
				<td align="center">
				<?php 
            echo $row->id;
            ?>
				</td>
				<td align="center">
				<?php 
            echo $row->links;
            ?>
				</td>
				<td align="left">
				<?php 
            echo $author;
            ?>
				</td>
				<td>
				<?php 
            echo $date;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>

		<?php 
        echo $pageNav->getListFooter();
        ?>
		<?php 
        mosCommonHTML::ContentLegend();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
		<input type="hidden" name="<?php 
        echo josSpoofValue();
        ?>
" value="1" />
		</form>
		<?php 
    }
    /**
     * Writes a list of the content items
     * @param array An array of content objects
     */
    function showList(&$rows, $search, $pageNav, $option, $lists)
    {
        global $my, $acl, $database;
        mosCommonHTML::loadOverlib();
        $nullDate = $database->getNullDate();
        ?>
		<form action="index2.php" method="post" name="adminForm">
		<table class="adminheading">
		<tr>
			<th class="frontpage" rowspan="2">
			Administrar Página Principal
			</th>
			<td width="right">
			<?php 
        echo $lists['sectionid'];
        ?>
			</td>
			<td width="right">
			<?php 
        echo $lists['catid'];
        ?>
			</td>
			<td width="right">
			<?php 
        echo $lists['authorid'];
        ?>
			</td>
		</tr>
		<tr>
			<td align="right" colspan="2">
			Filtro:
			</td>
			<td>
			<input type="text" name="search" value="<?php 
        echo htmlspecialchars($search);
        ?>
" class="text_area" onChange="document.adminForm.submit();" />
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<tr>
			<th width="5">
			nº
			</th>
			<th width="20">
			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
			</th>
			<th class="title">
			Título
			</th>
			<th width="10%" nowrap="nowrap">
			Publicado
			</th>
			<th colspan="2" nowrap="nowrap" width="5%">
			Reordenar
			</th>
			<th width="2%">
			Ordem
			</th>
			<th width="1%">
			<a href="javascript: saveorder( <?php 
        echo count($rows) - 1;
        ?>
 )"><img src="images/filesave.png" border="0" width="16" height="16" alt="Salvar Ordem" /></a>
			</th>
			<th width="8%" nowrap="nowrap">
			Acesso
			</th>
			<th width="10%" align="left">
			Seções
			</th>
			<th width="10%" align="left">
			Categoria
			</th>
			<th width="10%" align="left">
			Autor
			</th>
		</tr>
		<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            mosMakeHtmlSafe($row);
            $link = 'index2.php?option=com_content&sectionid=0&task=edit&hidemainmenu=1&id=' . $row->id;
            $row->sect_link = 'index2.php?option=com_sections&task=editA&hidemainmenu=1&id=' . $row->sectionid;
            $row->cat_link = 'index2.php?option=com_categories&task=editA&hidemainmenu=1&id=' . $row->catid;
            $now = _CURRENT_SERVER_TIME;
            if ($now <= $row->publish_up && $row->state == '1') {
                $img = 'publish_y.png';
                $alt = 'Publicado';
            } else {
                if (($now <= $row->publish_down || $row->publish_down == $nullDate) && $row->state == '1') {
                    $img = 'publish_g.png';
                    $alt = 'Publicado';
                } else {
                    if ($now > $row->publish_down && $row->state == '1') {
                        $img = 'publish_r.png';
                        $alt = 'Expirado';
                    } elseif ($row->state == "0") {
                        $img = "publish_x.png";
                        $alt = 'Despublicado';
                    }
                }
            }
            $times = '';
            if (isset($row->publish_up)) {
                if ($row->publish_up == $nullDate) {
                    $times .= '<tr><td>Início: Sempre</td></tr>';
                } else {
                    $times .= '<tr><td>Início: ' . $row->publish_up . '</td></tr>';
                }
            }
            if (isset($row->publish_down)) {
                if ($row->publish_down == $nullDate) {
                    $times .= '<tr><td>Fim: Não Expira</td></tr>';
                } else {
                    $times .= '<tr><td>Fim: ' . $row->publish_down . '</td></tr>';
                }
            }
            $access = mosCommonHTML::AccessProcessing($row, $i);
            $checked = mosCommonHTML::CheckedOutProcessing($row, $i);
            if ($acl->acl_check('administration', 'manage', 'users', $my->usertype, 'components', 'com_users')) {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id=' . $row->created_by;
                    $author = '<a href="' . $linkA . '" title="Editar Usuário">' . $row->author . '</a>';
                }
            } else {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $author = $row->author;
                }
            }
            ?>
			<tr class="<?php 
            echo "row{$k}";
            ?>
">
				<td>
				<?php 
            echo $pageNav->rowNumber($i);
            ?>
				</td>
				<td>
				<?php 
            echo $checked;
            ?>
				</td>
				<td>
				<?php 
            if ($row->checked_out && $row->checked_out != $my->id) {
                echo $row->title;
            } else {
                ?>
					<a href="<?php 
                echo $link;
                ?>
" title="Editar Conteúdo">
					<?php 
                echo $row->title;
                ?>
					</a>
					<?php 
            }
            ?>
				</td>
				<?php 
            if ($times) {
                ?>
					<td align="center">
					<a href="javascript: void(0);" onmouseover="return overlib('<table><?php 
                echo $times;
                ?>
</table>', CAPTION, 'Informações da Publicação', BELOW, RIGHT);" onMouseOut="return nd();" onclick="return listItemTask('cb<?php 
                echo $i;
                ?>
','<?php 
                echo $row->state ? "despublicar" : "publicar";
                ?>
')">
					<img src="images/<?php 
                echo $img;
                ?>
" width="12" height="12" border="0" alt="<?php 
                echo $alt;
                ?>
" />
					</a>
					</td>
					<?php 
            }
            ?>
				<td>
				<?php 
            echo $pageNav->orderUpIcon($i);
            ?>
				</td>
				<td>
				<?php 
            echo $pageNav->orderDownIcon($i, $n);
            ?>
				</td>
				<td align="center" colspan="2">
				<input type="text" name="order[]" size="5" value="<?php 
            echo $row->fpordering;
            ?>
" class="text_area" style="text-align: center" />
				</td>
				<td align="center">
				<?php 
            echo $access;
            ?>
				</td>
				<td>
				<a href="<?php 
            echo $row->sect_link;
            ?>
" title="Editar Seção">
				<?php 
            echo $row->sect_name;
            ?>
				</a>
				</td>
				<td>
				<a href="<?php 
            echo $row->cat_link;
            ?>
" title="Editar Categoria">
				<?php 
            echo $row->name;
            ?>
				</a>
				</td>
				<td>
				<?php 
            echo $author;
            ?>
				</td>
			</tr>
			<?php 
            $k = 1 - $k;
        }
        ?>
		</table>

		<?php 
        echo $pageNav->getListFooter();
        mosCommonHTML::ContentLegend();
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="<?php 
        echo josSpoofValue();
        ?>
" value="1" />
		</form>
		<?php 
    }