1: <?php
2: define('OFFSET_PATH', 3);
3: require_once("../../admin-globals.php");
4: require_once(SERVERPATH . '/' . ZENFOLDER . '/template-functions.php');
5: admin_securityChecks(ALBUM_RIGHTS, currentRelativeURL());
6:
7: function unpublishSubalbums($album) {
8: global $_zp_gallery;
9: $albums = $album->getAlbums();
10: foreach ($albums as $albumname) {
11: $subalbum = newAlbum($albumname);
12: $subalbum->setShow(false);
13: $subalbum->save();
14: unpublishSubalbums($subalbum);
15: }
16: }
17:
18: $report = false;
19: $publish_albums_list = array();
20: $publish_images_list = array();
21:
22: if (isset($_POST['set_defaults'])) {
23: XSRFdefender('publishContent');
24: $_zp_gallery->setAlbumPublish((int) isset($_POST['album_default']));
25: $_zp_gallery->setImagePublish((int) isset($_POST['image_default']));
26: $_zp_gallery->save();
27: $report = 'defaults';
28: } else if (isset($_POST['publish'])) {
29: $action = sanitize($_POST['publish']);
30: unset($_POST['publish']);
31: XSRFdefender('publishContent');
32: switch ($action) {
33: case 'albums':
34: unset($_POST['checkAllAuto']);
35: foreach ($_POST as $key => $albumid) {
36: $album = newAlbum(postIndexDecode($key));
37: $album->setShow(1);
38: $album->save();
39: }
40: $report = 'albums';
41: break;
42: case 'images':
43: foreach ($_POST as $action) {
44: $i = strrpos($action, '_');
45: $imageid = sanitize_numeric(substr($action, $i + 1));
46: $rowi = query_single_row('SELECT * FROM ' . prefix('images') . ' WHERE `id`=' . $imageid);
47: $rowa = query_single_row('SELECT * FROM ' . prefix('albums') . ' WHERE `id`=' . $rowi['albumid']);
48: $album = newAlbum($rowa['folder']);
49: $image = newImage($album, $rowi['filename']);
50: switch (substr($action, 0, $i)) {
51: case 'pub':
52: $image->setShow(1);
53: $image->save();
54: break;
55: case 'del':
56: $image->remove();
57: break;
58: }
59: }
60: $report = 'images';
61: break;
62: case 'categories':
63: $report = 'categories';
64: foreach ($_POST as $key => $titlelink) {
65: $obj = new ZenpageCategory($titlelink);
66: $obj->setShow(1);
67: $obj->save();
68: }
69: break;
70: case 'news':
71: $report = 'news';
72: foreach ($_POST as $key => $titlelink) {
73: $obj = new ZenpageNews($titlelink);
74: $obj->setShow(1);
75: $obj->save();
76: }
77: break;
78: case 'pages':
79: foreach ($_POST as $key => $titlelink) {
80: $obj = new ZenpagePage($titlelink);
81: $obj->setShow(1);
82: $obj->save();
83: }
84: $report = 'pages';
85: break;
86: }
87: }
88: if ($report) {
89: header('Location: ' . FULLWEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/publishContent/publishContent.php?report=' . $report);
90: exitZP();
91: } else {
92: if (isset($_GET['report'])) {
93: $report = sanitize($_GET['report']);
94: }
95: }
96: $zenphoto_tabs['overview']['subtabs'] = array(gettext('Content') => '');
97: printAdminHeader('overview', gettext('Content'));
98: datepickerJS();
99: ?>
100: <link rel="stylesheet" href="publishContent.css" type="text/css" media="screen" />
101: <?php
102: echo '</head>';
103: ?>
104: <body>
105: <?php printLogoAndLinks(); ?>
106: <div id="main">
107: <?php printTabs(); ?>
108: <div id="content">
109: <?php printSubtabs(); ?>
110: <div class="tabbox">
111: <?php zp_apply_filter('admin_note', 'schedule', ''); ?>
112: <h1><?php echo (gettext('Manage content publication')); ?></h1>
113: <?php
114: $albpublish = $_zp_gallery->getAlbumPublish();
115: $imgpublish = $_zp_gallery->getImagePublish();
116: if (isset($_POST['publish_date'])) {
117: $requestdate = dateTimeConvert(sanitize($_POST['publish_date']));
118: } else {
119: $requestdate = date('Y-m-d H:i:s');
120: }
121:
122: $albumidlist = '';
123: $albumids = '';
124: if (zp_loggedin(ADMIN_RIGHTS)) {
125: $albumlist = $_zp_gallery->getAlbums();
126: } else {
127: $albumlist = getManagedAlbumList();
128: $albumIDs = array();
129: foreach ($albumlist as $albumname) {
130: $subalbums = getAllSubAlbumIDs($albumname);
131: foreach ($subalbums as $ID) {
132: $albumIDs[] = $ID['id'];
133: }
134: }
135: $i = 0;
136: foreach ($albumIDs as $ID) {
137: if ($i > 0) {
138: $albumidlist .= ' OR ';
139: $albumids .= ' OR ';
140: }
141: $albumidlist .= prefix('images') . '.albumid=' . $ID;
142: $albumids .= '`id`=' . $ID;
143: $i++;
144: }
145: if (!empty($albumlist)) {
146: $albumids = ' AND (' . $albumids . ')';
147: $albumidlist = ' AND (' . $albumidlist . ')';
148: }
149: }
150: if (isset($_GET['propagate_unpublished'])) {
151: foreach ($albumlist as $albumname) {
152: $album = newAlbum($albumname);
153: if (!$album->getShow()) {
154: unpublishSubalbums($album);
155: }
156: }
157: unset($_GET['propagate_unpublished']);
158: $report = 'propagate';
159: }
160:
161: $mtime = dateTimeConvert($requestdate, true);
162: $sql = "SELECT `folder`, `id` FROM " . prefix('albums') . ' WHERE `show`="0"' . $albumids;
163: $result = query_full_array($sql);
164: if (is_array($result)) {
165: foreach ($result as $row) {
166: $publish_albums_list[$row['folder']] = $row['id'];
167: }
168: }
169: $sql = 'SELECT `filename`, ' . prefix('images') . '.id as id, folder FROM ' . prefix('images') . ',' . prefix('albums') . ' WHERE ' .
170: prefix('images') . '.show="0" AND ' . prefix('images') . '.mtime < "' . $mtime . '" AND ' . prefix('albums') . '.id=' .
171: prefix('images') . '.albumid' . $albumidlist;
172: $result = query_full_array($sql);
173: if (is_array($result)) {
174: foreach ($result as $row) {
175: $publish_images_list[$row['folder']][$row['filename']] = $row['id'];
176: }
177: ksort($publish_images_list, SORT_LOCALE_STRING);
178: }
179:
180:
181: if (zp_loggedin(ADMIN_RIGHTS)) {
182: ?>
183: <fieldset class="smallbox">
184: <legend><?php echo gettext('Image and album <em>Discovery</em> options'); ?></legend>
185: <div id="pubbox">
186: <?php
187: if ($report == 'defaults') {
188: ?>
189: <div class="messagebox fade-message">
190: <h2><?php echo gettext('Defaults applied'); ?></h2>
191: </div>
192: <?php
193: }
194: ?>
195: <form class="dirty-check" name="set_publication" action="" method="post" autocomplete="off">
196: <?php XSRFToken('publishContent'); ?>
197: <input type="hidden" name="set_defaults" value="true" />
198: <label><input type="checkbox" name="album_default" value="1"<?php if ($albpublish) echo ' checked="checked"'; ?> /> <?php echo gettext("Publish albums by default"); ?></label>
199:
200: <label><input type="checkbox" name="image_default" value="1"<?php if ($imgpublish) echo ' checked="checked"'; ?> /> <?php echo gettext("Publish images by default"); ?></label>
201: <br class="clearall" />
202: <br class="clearall" />
203: <div class="buttons pad_button" id="setdefaults">
204: <button class="tooltip" type="submit" title="<?php echo gettext("Set defaults for album publishing and image visibility."); ?>">
205: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/burst.png" alt="" /> <?php echo gettext("Apply"); ?>
206: </button>
207: </div>
208: </form>
209: <br class="clearall" />
210: </div>
211: </fieldset>
212: <br class="clearall" />
213: <br class="clearall" />
214: <?php
215: }
216: ?>
217: <p class="notebox smallbox"><strong>Note: </strong><?php echo gettext('The number of un-published items does <strong>not</strong> include items that are un-published by <a href="http://www.zenphoto.org/news/an-overview-of-zenphoto-users#rules-of-protection-andvisibility-for-zenphoto-obj">inheritance</a>.'); ?></p>
218: <?php $visible = $report == 'albums' || $report == 'propagate'; ?>
219: <fieldset class="smallbox">
220: <legend><?php
221: reveal('albumbox', $visible);
222: echo gettext('Albums not published');
223: ?></legend>
224: <?php
225: if (($c = count($publish_albums_list)) > 0) {
226: echo sprintf(ngettext('%u unpublished album', '%u unpublished albums', $c), $c);
227: }
228: ?>
229: <div id="albumbox"<?php if (!$visible) echo ' style="display:none"' ?>>
230: <?php
231: switch ($report) {
232: case 'albums':
233: ?>
234: <div class="messagebox fade-message">
235: <h2><?php echo gettext('Album changes applied'); ?></h2>
236: </div>
237: <?php
238: break;
239: case 'propagate':
240: ?>
241: <div class="messagebox fade-message">
242: <h2><?php echo gettext('Unpublished state propagated'); ?></h2>
243: </div>
244: <?php
245: break;
246: }
247: if ($c > 0) {
248: ?>
249: <form class="dirty-check" name="publish_albums" action="" method="post" autocomplete="off"><?php echo gettext('Albums:'); ?>
250: <label id="autocheck">
251: <input type="checkbox" name="checkAllAuto" id="checkAllAuto" onclick="$('.checkAuto').prop('checked', $('#checkAllAuto').prop('checked'));"/>
252: <span id="autotext"><?php echo gettext('all'); ?></span>
253: </label>
254: <?php XSRFToken('publishContent'); ?>
255: <input type="hidden" name="publish" value="albums" />
256: <ul class="schedulealbumchecklist">
257: <?php
258: foreach ($publish_albums_list as $analbum => $albumid) {
259: $album = newAlbum($analbum);
260: $thumbimage = $album->getAlbumThumbImage();
261: $thumb = getAdminThumb($thumbimage, 'large');
262: ?>
263: <li>
264: <label>
265: <input type="checkbox" class="checkAuto" name="<?php echo postIndexEncode($analbum); ?>" value="<?php echo $albumid; ?>" class="albumcheck" />
266: <img src="<?php echo html_encode(pathurlencode($thumb)); ?>" width="60" height="60" alt="" title="album thumb" />
267: <?php echo $album->name; ?>
268: </label>
269: <a href="<?php echo $album->getLink(); ?>" title="<?php echo gettext('view'); ?>"> (<?php echo gettext('view'); ?>)</a>
270: </li>
271: <?php
272: }
273: ?>
274: </ul>
275: <br class="clearall" />
276: <br class="clearall" />
277:
278: <div class="buttons pad_button" id="publishalbums">
279: <button class="tooltip" type="submit" title="<?php echo gettext("Publish waiting albums."); ?>">
280: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/cache.png" alt="" /> <?php echo gettext("Publish albums"); ?>
281: </button>
282: </div>
283: <br class="clearall" />
284: </form>
285: <p class="buttons tooltip">
286: <a href="?propagate_unpublished" title="<?php echo gettext('Set all subalbums of an un-published album to un-published.'); ?>">
287: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/redo.png" alt="" />
288: <?php echo gettext('Propagate un-published state'); ?>
289: </a>
290: </p>
291: <br class="clearall" />
292: <?php
293: }
294: ?>
295: </div>
296: <?php
297: if ($c == 0) {
298: echo gettext('No albums are un-published.');
299: }
300: ?>
301: </fieldset>
302: <br class="clearall" />
303:
304: <script type="text/javascript">
305:
306: $(function() {
307: $("#publish_date").datepicker({
308: dateFormat: 'yy-mm-dd',
309: showOn: 'button',
310: buttonImage: '<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/calendar.png',
311: buttonText: '<?php echo gettext('calendar'); ?>',
312: buttonImageOnly: true
313: });
314: });
315:
316: </script>
317: <?php $visible = $report == 'images'; ?>
318: <fieldset class="smallbox">
319: <legend><?php
320: reveal('imagebox', $visible);
321: echo gettext('Images not published');
322: ?></legend>
323: <div id="imagebox"<?php if (!$visible) echo ' style="display:none"' ?>>
324: <form name="review" action="" method="post">
325: <?php XSRFToken('publishContent'); ?>
326: <?php printf(gettext('Review images older than: %s'), '<input type="text" size="20" id="publish_date" name="publish_date" value="' . $requestdate . '" />'); ?>
327: <br class="clearall" />
328: <br class="clearall" />
329: <input type="hidden" name="review" value="true" />
330: <div class="buttons pad_button" id="reviewobjects">
331: <button class="tooltip" type="submit" title="<?php echo gettext("Review un-published images."); ?>">
332: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/warn.png" alt="" /> <?php echo gettext("Review images"); ?>
333: </button>
334: </div>
335: </form>
336: <br class="clearall" />
337: <br class="clearall" />
338: <?php
339: $c = count($publish_images_list);
340: ?>
341:
342: <?php
343: if ($report == 'images') {
344: ?>
345: <div class="messagebox fade-message">
346: <h2><?php echo gettext('Image changes applied'); ?></h2>
347: </div>
348: <?php
349: }
350: if ($c > 0) {
351: ?>
352: <script type="text/javascript">
353:
354: function confirmdel(obj, id, msg) {
355: if (msg) {
356: if (confirm('<?php echo gettext("Are you sure you want to select this image for deletion?"); ?>')) {
357: jQuery('#' + id).css({color: 'red'});
358: obj.checked = true;
359: }
360: } else {
361: jQuery('#' + id).css({color: 'black'});
362: obj.checked = true;
363: }
364: }
365: function publishAll(id, what) {
366: if (id) {
367: $('.album_' + id + '_' + what).prop('checked', true);
368: } else {
369: $('.global_' + what).prop('checked', true);
370: }
371: }
372:
373: </script>
374: <form class="dirty-check" name="publish_images" action="" method="post" autocomplete="off"><?php echo gettext('Images:'); ?>
375:
376: <?php XSRFToken('publishContent'); ?>
377: <input type="hidden" name="publish" value="images" />
378: <ul class="scheduleimagechecklist">
379: <?php
380: foreach ($publish_images_list as $key => $imagelist) {
381: $album = newAlbum($key);
382: $albumid = $album->getID();
383: $imagelist = array_flip($imagelist);
384: natcasesort($imagelist);
385: $imagelist = array_flip($imagelist);
386: ?>
387: <li>
388: <p class="scheduleimagechecklisthead">
389: <a href="javascript:publishAll(<?php echo $albumid; ?>,'p');" title="<?php echo gettext('Set all to be published'); ?>">
390: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/pass.png" style="border: 0px;" alt="publish all" />
391: </a>
392: <a href="javascript:publishAll(<?php echo $albumid; ?>,'u');" title="<?php echo gettext('Set all to be un-published'); ?>">
393: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/reset.png" style="border: 0px;" alt="unpublish all" />
394: </a>
395: <a href="javascript:publishAll(<?php echo $albumid; ?>,'d');" title="<?php echo gettext('Set all to be deleted'); ?>">
396: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/fail.png" style="border: 0px;" alt="delete all" />
397: </a>
398: <strong><?php echo $key; ?></strong>
399: </p>
400: <ul class="scheduleimagelist">
401: <?php
402: foreach ($imagelist as $display => $item) {
403: ?>
404: <li>
405: <table>
406: <tr>
407: <td>
408: <label style="white-space:nowrap">
409: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/pass.png" style="border: 0px;" alt="publish" />
410: <input id="pub_<?php echo $item; ?>" class="album_<?php echo $albumid; ?>_p global_p" name="r_<?php echo $item; ?>" type="radio" value="pub_<?php echo $item; ?>" onclick="confirmdel(this, 'label_del_<?php echo $item; ?>', false)" />
411: <?php echo gettext('Publish'); ?>
412: </label>
413: <label style="white-space:nowrap">
414: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/reset.png" style="border: 0px;" alt="unpublish" />
415: <input id="notpub_<?php echo $item; ?>" class="album_<?php echo $albumid; ?>_u global_u" name="r_<?php echo $item; ?>" type="radio" value="notpub_<?php echo $item; ?>" checked="checked" onclick="confirmdel(this, 'label_del_<?php echo $item; ?>', false)" />
416: <?php echo gettext('Do not publish'); ?>
417: </label>
418: <label id="label_del_<?php echo $item; ?>" style="white-space:nowrap">
419: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/fail.png" style="border: 0px;" alt="delete" />
420: <input id="del_<?php echo $item; ?>" class="album_<?php echo $albumid; ?>_d" name="r_<?php echo $item; ?>" type="radio" value="del_<?php echo $item; ?>" onclick="confirmdel(this, 'label_del_<?php echo $item; ?>', true)" />
421: <?php echo gettext('Delete'); ?>
422: </label>
423: </td>
424: <td>
425: <?php $image = newImage($album, $display); ?>
426: <img src="<?php echo html_encode(pathurlencode(getAdminThumb($image, 'large'))); ?>" alt="<?php echo $image->filename; ?>"/>
427: </td>
428: <td>
429: <?php printf(gettext('%s'), $display); ?><a href="<?php echo html_encode($image->getLink()); ?>" title="<?php echo html_encode($image->getTitle()); ?>"> (<?php echo gettext('View'); ?>)</a>
430: </td>
431:
432: </tr>
433: </table>
434: </li>
435: <?php
436: }
437: ?>
438: </ul>
439: </li>
440: <?php
441: }
442: ?>
443: </ul>
444: <p class="scheduleimagechecklisthead">
445: <a href="javascript:publishAll('','p');" title="<?php echo gettext('Set all to be published'); ?>">
446: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/pass.png" style="border: 0px;" alt="publish all" />
447: </a>
448: <a href="javascript:publishAll('','u');" title="<?php echo gettext('Set all to be un-published'); ?>">
449: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/reset.png" style="border: 0px;" alt="unpublish all" />
450: </a>
451: <strong><?php echo gettext('all images'); ?></strong>
452: </p>
453:
454: <div class="buttons pad_button" id="process">
455: <button class="tooltip" type="submit" title="<?php echo gettext("Process the above changes."); ?>">
456: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/cache.png" alt="" /> <?php echo gettext("Process changes"); ?>
457: </button>
458: </div>
459: <br class="clearall" />
460: </form>
461: <?php
462: }
463: ?>
464: </div>
465: <?php
466: if (count($publish_images_list) > 0) {
467: echo sprintf(ngettext('%u album with unpublished images', '%u albums with unpublished images', $c), $c);
468: } else {
469: echo gettext('No images meet the criteria.');
470: }
471: ?>
472: </fieldset>
473: <?php
474: if (class_exists('Zenpage')) {
475: $visible = $report == 'categories';
476: $items = $_zp_zenpage->getAllCategories(false);
477: $output = '';
478: $c = 0;
479: foreach ($items as $key => $item) {
480: $itemobj = new ZenpageCategory($item['titlelink']);
481: if (!$itemobj->getShow()) {
482: $c++;
483: $output .= '<li><label><input type="checkbox" name="' . $item['titlelink'] . '" value="' . $item['titlelink'] . '" class="catcheck" />' . $itemobj->getTitle() . '</label><a href="' . html_encode($itemobj->getLink()) . '" title="' . html_encode($itemobj->getTitle()) . '"> (' . gettext('View') . ')</a></li>';
484: }
485: }
486: ?>
487: <br class="clearall" />
488: <fieldset class="smallbox">
489: <legend><?php
490: reveal('catbox', $visible);
491: echo gettext('Categories not published');
492: ?></legend>
493: <?php
494: if ($output) {
495: echo sprintf(ngettext('%u unpublished category', '%u unpublished categories', $c), $c);
496: ?>
497: <div id="catbox"<?php if (!$visible) echo ' style="display:none"' ?>>
498: <?php
499: if ($report == 'categories') {
500: ?>
501: <div class="messagebox fade-message">
502: <h2><?php echo gettext('Category changes applied'); ?></h2>
503: </div>
504: <?php
505: }
506: ?>
507: <form class="dirty-check" name="publish_cat" action="" method="post" autocomplete="off"><?php echo gettext('Categories:'); ?>
508: <label id="autocheck_cat">
509: <input type="checkbox" id="checkAllcat" name="checkAllcat" onclick="$('.catcheck').prop('checked', $('#checkAllcat').prop('checked'));" />
510: <span id="autotext_cat"><?php echo gettext('all'); ?></span>
511: </label>
512: <?php XSRFToken('publishContent'); ?>
513: <input type="hidden" name="publish" value="categories" />
514: <ul class="schedulealbumchecklist">
515: <?php echo $output; ?>
516: </ul>
517: <br class="clearall" />
518: <div class="buttons pad_button">
519: <button class="tooltip" type="submit" title="<?php echo gettext("Publish waiting categories."); ?>">
520: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/cache.png" alt="" /> <?php echo gettext("Publish categories"); ?>
521: </button>
522: </div>
523: <br class="clearall" />
524: </form>
525: </div>
526: <?php
527: } else {
528: echo gettext('No unpublished categories');
529: }
530: ?>
531: </fieldset>
532: <br class="clearall" />
533: <?php
534: $visible = $report == 'news';
535: $items = $_zp_zenpage->getArticles(0, false);
536: $output = '';
537: $c = 0;
538: foreach ($items as $key => $item) {
539: $itemobj = new ZenpageNews($item['titlelink']);
540: if (!$itemobj->getShow()) {
541: $c++;
542: $output .= '<li><label><input type="checkbox" name="' . $item['titlelink'] . '" value="' . $item['titlelink'] . '" class="artcheck" />' . $itemobj->getTitle() . '</label><a href="' . html_encode($itemobj->getLink()) . '" title="' . html_encode($itemobj->getTitle()) . '"> (' . gettext('View') . ')</a></li>';
543: }
544: }
545: ?>
546: <fieldset class="smallbox">
547: <legend><?php
548: reveal('newsbox', $visible);
549: echo gettext('News articles not published');
550: ?></legend>
551: <?php
552: if ($output) {
553: echo sprintf(ngettext('%u unpublished article', '%u unpublished articles', $c), $c);
554: ?>
555: <div id="newsbox"<?php if (!$visible) echo ' style="display:none"' ?>>
556: <?php
557: if ($report == 'news') {
558: ?>
559: <div class="messagebox fade-message">
560: <h2><?php echo gettext('News article changes applied'); ?></h2>
561: </div>
562: <?php
563: }
564: ?>
565: <form class="dirty-check" name="publish_articles" action="" method="post" autocomplete="off"><?php echo gettext('Articles:'); ?>
566: <label id="autocheck_art">
567: <input type="checkbox" name="checkAllcat" onclick="$('.artcheck').prop('checked', checked)" />
568: <span id="autotext_art"><?php echo gettext('all'); ?></span>
569: </label>
570: <?php XSRFToken('publishContent'); ?>
571: <input type="hidden" name="publish" value="news" />
572: <ul class="schedulealbumchecklist">
573: <?php echo $output; ?>
574: </ul>
575: <br class="clearall" />
576: <div class="buttons pad_button">
577: <button class="tooltip" type="submit" title="<?php echo gettext("Publish waiting articles."); ?>">
578: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/cache.png" alt="" /> <?php echo gettext("Publish articles"); ?>
579: </button>
580: </div>
581: <br class="clearall" />
582: </div>
583: <?php
584: } else {
585: echo gettext('No unpublished articles');
586: }
587: ?>
588: </fieldset>
589: <?php
590: $visible = $report == 'pages';
591: $items = $_zp_zenpage->getPages(false);
592: $output = '';
593: $c = 0;
594: foreach ($items as $key => $item) {
595: $itemobj = new ZenpagePage($item['titlelink']);
596: if (!$itemobj->getShow()) {
597: $c++;
598: $output .= '<li><label><input type="checkbox" name="' . $item['titlelink'] . '" value="' . $item['titlelink'] . '" class="pagecheck" />' . $itemobj->getTitle() . '</label><a href="' . html_encode($itemobj->getLink()) . '" title="' . html_encode($itemobj->getTitle()) . '"> (' . gettext('View') . ')</a></li>';
599: }
600: }
601: ?>
602: <br class="clearall" />
603: <fieldset class="smallbox">
604: <legend><?php
605: reveal('pagebox', $visible);
606: echo gettext('Pages not published');
607: ?></legend>
608: <?php
609: if ($report == 'pages') {
610: ?>
611: <div class="messagebox fade-message">
612: <h2><?php echo gettext('Pages changes applied'); ?></h2>
613: </div>
614: <?php
615: }
616: if ($output) {
617: echo sprintf(ngettext('%u unpublished page', '%u unpublished pages', $c), $c);
618: ?>
619: <div id="pagebox"<?php if (!$visible) echo ' style="display:none"' ?>>
620: <form class="dirty-check" name="publish_pages" action="" method="post" autocomplete="off"><?php echo gettext('Pages:'); ?>
621: <label id="autocheck_page">
622: <input type="checkbox" name="checkAllpage" onclick="$('.pagecheck').prop('checked', checked);" />
623: <span id="autotext_page"><?php echo gettext('all'); ?></span>
624: </label>
625: <?php XSRFToken('publishContent'); ?>
626: <input type="hidden" name="publish" value="pages" />
627: <ul class="schedulealbumchecklist">
628: <?php echo $output; ?>
629: </ul>
630: <br class="clearall" />
631: <div class="buttons pad_button">
632: <button class="tooltip" type="submit" title="<?php echo gettext("Publish waiting pages."); ?>">
633: <img src="<?php echo WEBPATH . '/' . ZENFOLDER; ?>/images/cache.png" alt="" /> <?php echo gettext("Publish pages"); ?>
634: </button>
635: </div>
636: </div>
637: <?php
638: } else {
639: echo gettext('No unpublished pages');
640: }
641: ?>
642: <br class="clearall" />
643: </fieldset>
644: <?php
645: }
646: ?>
647: </div><!-- content -->
648: </div><!-- main -->
649: <?php printAdminFooter(); ?>
650: </body>
651: <?php
652: echo "</html>";
653: ?>
654: