Exemplo n.º 1
0
									<td>
										<?php 
    switch ($article->getSticky()) {
        case 1:
            $sticky = ' <small>[' . gettext('sticky') . ']</small>';
            break;
        case 9:
            $sticky = ' <small><strong>[' . gettext('sticky') . ']</strong></small>';
            break;
        default:
            $sticky = '';
            break;
    }
    echo '<a href="admin-edit.php' . getNewsAdminOptionPath(array_merge(array('newsarticle' => NULL, 'titlelink' => urlencode($article->getTitlelink())), getNewsAdminOption(NULL))) . '">';
    checkForEmptyTitle($article->getTitle(), "news");
    echo '</a>' . checkHitcounterDisplay($article->getHitcounter()) . $sticky;
    ?>

									</td>
									<td>
										<?php 
    printNewsCategories($article);
    ?>
<br />
									</td>
									<td>
										<?php 
    echo html_encode($article->getAuthor());
    ?>
									</td>
									<td>
/**
 * Prints the list entry of a single category for the sortable list
 *
 * @param array $cat Array storing the db info of the category
 * @param string $flag If the category is protected
 * @return string
 */
function printCategoryListSortableTable($cat, $flag)
{
    global $_zp_zenpage;
    if ($flag) {
        $img = '../../images/drag_handle_flag.png';
    } else {
        $img = '../../images/drag_handle.png';
    }
    $count = count($cat->getArticles(0, false));
    if ($cat->getTitle()) {
        $cattitle = $cat->getTitle();
    } else {
        $cattitle = "<span style='color:red; font-weight: bold'>" . ' *' . $cat->getTitlelink() . "*</span>";
    }
    ?>
	 <div class='page-list_row'>
		<div class='page-list_title' >
		<?php 
    echo "<a href='admin-edit.php?category&amp;titlelink=" . $cat->getTitlelink() . "' title='" . gettext('Edit this category') . "'>" . $cattitle . "</a>" . checkHitcounterDisplay($cat->getHitcounter());
    ?>
		</div>
		<div class="page-list_extra"><?php 
    echo $count;
    ?>
 <?php 
    echo gettext("articles");
    ?>
		</div>
		<div class="page-list_iconwrapper">
			<div class="page-list_icon"><?php 
    $password = $cat->getPassword();
    if (!empty($password) && GALLERY_SECURITY != 'private') {
        echo '<img src="../../images/lock.png" style="border: 0px;" alt="' . gettext('Password protected') . '" title="' . gettext('Password protected') . '" />';
    }
    ?>
			</div>
			<div class="page-list_icon">
			<?php 
    if ($cat->getShow()) {
        $title = gettext("Un-publish");
        ?>
				<a href="?publish=0&amp;titlelink=<?php 
        echo html_encode($cat->getTitlelink());
        ?>
&amp;XSRFToken=<?php 
        echo getXSRFToken('update');
        ?>
" title="<?php 
        echo $title;
        ?>
">
				<img src="../../images/pass.png" alt="<?php 
        gettext("Scheduled for published");
        ?>
" title="<?php 
        echo $title;
        ?>
" /></a>
				<?php 
    } else {
        $title = gettext("Publish");
        ?>
				<a href="?publish=1&amp;titlelink=<?php 
        echo html_encode($cat->getTitlelink());
        ?>
&amp;XSRFToken=<?php 
        echo getXSRFToken('update');
        ?>
" title="<?php 
        echo $title;
        ?>
">
				<img src="../../images/action.png" alt="<?php 
        echo gettext("Un-published");
        ?>
" title="<?php 
        echo $title;
        ?>
" /></a>
				<?php 
    }
    ?>
			</div>
			<div class="page-list_icon">
			<?php 
    if ($count == 0) {
        ?>
				<img src="../../images/icon_inactive.png" alt="<?php 
        gettext('locked');
        ?>
" />
			<?php 
    } else {
        ?>
				<a href="../../../index.php?p=news&amp;category=<?php 
        echo js_encode($cat->getTitlelink());
        ?>
" title="<?php 
        echo gettext("View category");
        ?>
">
				<img src="images/view.png" alt="view" />
				</a>
			<?php 
    }
    ?>
			</div>
			<div class="page-list_icon"><a
					href="?hitcounter=1&amp;id=<?php 
    echo $cat->getID();
    ?>
&amp;tab=categories&amp;XSRFToken=<?php 
    echo getXSRFToken('hitcounter');
    ?>
"
					title="<?php 
    echo gettext("Reset hitcounter");
    ?>
"> <img
					src="../../images/reset.png"
					alt="<?php 
    echo gettext("Reset hitcounter");
    ?>
" /> </a>
			</div>
			<div class="page-list_icon"><a
					href="javascript:confirmDelete('admin-categories.php?delete=<?php 
    echo js_encode($cat->getTitlelink());
    ?>
&amp;tab=categories&amp;XSRFToken=<?php 
    echo getXSRFToken('delete_category');
    ?>
',deleteCategory)"
					title="<?php 
    echo gettext("Delete Category");
    ?>
"><img
					src="../../images/fail.png" alt="<?php 
    echo gettext("Delete");
    ?>
"
					title="<?php 
    echo gettext("Delete Category");
    ?>
" /></a>
			</div>
			<div class="page-list_icon"><input class="checkbox" type="checkbox" name="ids[]" value="<?php 
    echo $cat->getTitlelink();
    ?>
"
					onclick="triggerAllBox(this.form, 'ids[]', this.form.allbox);" />
			</div>
	</div>
</div>
<?php 
}
								</label>
							</td>
						</tr>
					<?php 
foreach ($result as $article) {
    $article = new ZenpageNews($article['titlelink']);
    ?>
						<tr class="newstr">
							<td>
							 <?php 
    if (checkIfLockedNews($article)) {
        echo '<a href="admin-edit.php?newsarticle&amp;titlelink=' . urlencode($article->getTitlelink()) . '&amp;pagenr=' . $_zp_zenpage->getCurrentAdminNewsPage() . '">';
        checkForEmptyTitle($article->getTitle(), "news");
        echo '</a>' . checkHitcounterDisplay($article->getHitcounter());
    } else {
        echo checkForEmptyTitle($article->getTitle(), "news") . '</a>' . checkHitcounterDisplay($article->getHitcounter());
    }
    ?>

							</td>
							<td>
							<?php 
    checkIfScheduled($article);
    checkIfExpires($article);
    ?>
							</td>
							<td>
							<?php 
    printArticleCategories($article);
    ?>
<br />