/**
     * 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 
    }
Esempio n. 2
0
 function CheckedOutProcessing(&$row, $i)
 {
     $my = mamboCore::get('currentUser');
     if ($row->checked_out) {
         $checked = mosCommonHTML::checkedOut($row);
     } else {
         $checked = mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id);
     }
     return $checked;
 }
Esempio n. 3
0
 function CheckedOutProcessing(&$row, $i)
 {
     global $my;
     if ($row->checked_out) {
         $checked = mosCommonHTML::checkedOut($row);
     } else {
         $checked = mosHTML::idBox($i, $row->id, $row->checked_out && $row->checked_out != $my->id);
     }
     return $checked;
 }