コード例 #1
0
/**
 * Prints the dropdown menu for the category selector for the news articles list
 *
 */
function printCategoryDropdown()
{
    global $_zp_zenpage;
    $currentpage = $_zp_zenpage->getCurrentAdminNewsPage();
    $result = $_zp_zenpage->getAllCategories(false);
    if (isset($_GET['date'])) {
        $datelink = "&date=" . $_GET['date'];
        $datelinkall = "?date=" . $_GET['date'];
    } else {
        $datelink = "";
        $datelinkall = "";
    }
    if (isset($_GET['category'])) {
        $selected = '';
        $category = sanitize($_GET['category']);
    } else {
        $selected = "selected='selected'";
        $category = "";
    }
    ?>
	<form name ="AutoListBox2" id="categorydropdown" style="float:left" action="#" >
	<select name="ListBoxURL" size="1" onchange="gotoLink(this.form)">
		<?php 
    echo "<option {$selected} value='admin-news-articles.php?pagenr=" . $currentpage . getNewsAdminOptionPath(false, true, true) . "'>" . gettext("All categories") . "</option>\n";
    foreach ($result as $cat) {
        $catobj = new ZenpageCategory($cat['titlelink']);
        // check if there are articles in this category. If not don't list the category.
        $count = count($catobj->getArticles(0, 'all'));
        $count = " (" . $count . ")";
        if ($category == $cat['titlelink']) {
            $selected = "selected='selected'";
        } else {
            $selected = "";
        }
        //This is much easier than hacking the nested list function to work with this
        $getparents = $catobj->getParents();
        $levelmark = '';
        foreach ($getparents as $parent) {
            $levelmark .= '&raquo; ';
        }
        $title = $catobj->getTitle();
        if (empty($title)) {
            $title = '*' . $catobj->getTitlelink() . '*';
        }
        if ($count != " (0)") {
            echo "<option {$selected} value='admin-news-articles.php?pagenr=" . $currentpage . "&amp;category=" . $catobj->getTitlelink() . getNewsAdminOptionPath(false, true, true) . "'>" . $levelmark . $title . $count . "</option>\n";
        }
    }
    ?>
	</select>
	<script language="JavaScript" type="text/javascript" >
		// <!-- <![CDATA[
		function gotoLink(form) {
		var OptionIndex=form.ListBoxURL.selectedIndex;
		parent.location = form.ListBoxURL.options[OptionIndex].value;}
		// ]]> -->
</script>
</form>
<?php 
}
コード例 #2
0
ファイル: admin-news.php プロジェクト: ariep/ZenPhoto20-DEV
    printExpired($article);
    ?>
									</td>
									<td class="page-list_icon">
										<?php 
    if ($article->inProtectedCategory()) {
        echo '<img src="../../images/lock.png" style="border: 0px;" alt="' . gettext('Password protected') . '" title="' . gettext('Password protected') . '" />';
    }
    ?>
									</td>
									<td><?php 
    echo linkPickerIcon($article);
    ?>
</td>
									<?php 
    $option = getNewsAdminOptionPath(getNewsAdminOption(NULL));
    if (empty($option)) {
        $divider = '?';
    } else {
        $divider = '&amp;';
    }
    if (checkIfLocked($article)) {
        ?>
										<td class="page-list_icon">
											<?php 
        printPublishIconLink($article, $option);
        ?>
										</td>
										<td class="page-list_icon">
											<?php 
        if ($article->getCommentsAllowed()) {
コード例 #3
0
								</td>
								<td>
									<?php 
    printExpired($article);
    ?>
								</td>
								<td class="page-list_icon">
									<?php 
    if ($article->inProtectedCategory()) {
        echo '<img src="../../images/lock.png" style="border: 0px;" alt="' . gettext('Password protected') . '" title="' . gettext('Password protected') . '" />';
    }
    ?>
								</td>

								<?php 
    $option = getNewsAdminOptionPath(getNewsAdminOption(array('category' => 0, 'date' => 0, 'published' => 0, 'sortorder' => 0, 'articles_page' => 1, 'subpage' => 1)));
    if (empty($option)) {
        $divider = '?';
    } else {
        $divider = '&amp;';
    }
    if (checkIfLockedNews($article)) {
        ?>
									<td class="page-list_icon">
										<?php 
        printPublishIconLink($article, 'news');
        ?>
									</td>
									<td class="page-list_icon">
										<?php 
        if ($article->getCommentsAllowed()) {
コード例 #4
0
/**
 * Prints the dropdown menu for the articles per page selector for the news articles list
 *
 */
function printArticlesPerPageDropdown()
{
    global $_zp_zenpage, $subpage, $articles_page;
    ?>
	<form name="AutoListBox5" id="articlesperpagedropdown" method="POST" style="float: left; margin-left: 10px;"	action="#">
		<select name="ListBoxURL" size="1"	onchange="gotoLink(this.form)">
			<?php 
    $option = getNewsAdminOption(array('category' => 0, 'date' => 0, 'published' => 0, 'sortorder' => 0));
    $list = array_unique(array(15, 30, 60, max(1, getOption('articles_per_page'))));
    sort($list);
    foreach ($list as $count) {
        ?>
				<option <?php 
        if ($articles_page == $count) {
            echo 'selected="selected"';
        }
        ?>
 value="admin-news-articles.php<?php 
        echo getNewsAdminOptionPath(array_merge(array('articles_page' => $count, 'subpage' => (int) ($subpage * $articles_page / $count)), $option));
        ?>
"><?php 
        printf(gettext('%u per page'), $count);
        ?>
</option>
				<?php 
    }
    ?>
			<option <?php 
    if ($articles_page == 0) {
        echo 'selected="selected"';
    }
    ?>
 value="admin-news-articles.php<?php 
    echo getNewsAdminOptionPath(array_merge(array('articles_page' => 'all'), $option));
    ?>
"><?php 
    echo gettext("All");
    ?>
</option>

		</select>
		<script type="text/javascript">
			// <!-- <![CDATA[
			function gotoLink(form) {
				var OptionIndex = form.ListBoxURL.selectedIndex;
				parent.location = form.ListBoxURL.options[OptionIndex].value;
			}
			// ]]> -->
		</script>
		&nbsp;&nbsp;
	</form>
	<?php 
}
コード例 #5
0
/**
 * Prints the dropdown menu for the articles per page selector for the news articles list
 *
 */
function printArticlesPerPageDropdown($subpage)
{
    global $_zp_CMS, $articles_page;
    $option = getNewsAdminOption('articles_page');
    ?>
	<form name="AutoListBox5" id="articlesperpagedropdown" method="POST" style="float:left; margin:5px;"	action="#">
		<select name="ListBoxURL" size="1"	onchange="gotoLink(this.form)">
			<?php 
    $list = array_unique(array(15, 30, 60, max(1, getOption('articles_per_page'))));
    sort($list);
    foreach ($list as $count) {
        ?>
				<option <?php 
        if ($articles_page == $count) {
            echo 'selected="selected"';
        }
        ?>
 value="admin-news.php<?php 
        echo getNewsAdminOptionPath(array_merge(array('articles_page' => $count, 'subpage' => (int) ($subpage * $articles_page / $count)), $option));
        ?>
"><?php 
        printf(gettext('%u per page'), $count);
        ?>
</option>
				<?php 
    }
    ?>
			<option <?php 
    if ($articles_page == 0) {
        echo 'selected="selected"';
    }
    ?>
 value="admin-news.php<?php 
    echo getNewsAdminOptionPath(array_merge(array('articles_page' => 'all'), $option));
    ?>
"><?php 
    echo gettext("All");
    ?>
</option>
		</select>

	</form>
	<?php 
}