rs->isEmpty()) { echo '

'.__('No page').'

'; } else { $pager = new pager($page,$this->rs_count,$nb_per_page,10); $pager->html_prev = $this->html_prev; $pager->html_next = $this->html_next; $pager->var_page = 'page'; $html_block = ''. ''. ''. ''. ''. ''. ''. ''. '%s
'.__('Title').''.__('Date').''.__('Author').''.__('Comments').''.__('Trackbacks').''.__('Status').'
'; if ($enclose_block) { $html_block = sprintf($enclose_block,$html_block); } echo '

'.__('Page(s)').' : '.$pager->getLinks().'

'; $blocks = explode('%s',$html_block); echo $blocks[0]; $count = 0; while ($this->rs->fetch()) { echo $this->postLine($count); $count++; } echo $blocks[1]; echo '

'.__('Page(s)').' : '.$pager->getLinks().'

'; } } private function postLine($count) { $img = '%1$s'; switch ($this->rs->post_status) { case 1: $img_status = sprintf($img,__('published'),'check-on.png'); break; case 0: $img_status = sprintf($img,__('unpublished'),'check-off.png'); break; case -1: $img_status = sprintf($img,__('scheduled'),'scheduled.png'); break; case -2: $img_status = sprintf($img,__('pending'),'check-wrn.png'); break; } $protected = ''; if ($this->rs->post_password) { $protected = sprintf($img,__('protected'),'locker.png'); } $selected = ''; if ($this->rs->post_selected) { $selected = sprintf($img,__('hidden'),'hidden.png'); } $attach = ''; $nb_media = $this->rs->countMedia(); if ($nb_media > 0) { $attach_str = $nb_media == 1 ? __('%d attachment') : __('%d attachments'); $attach = sprintf($img,sprintf($attach_str,$nb_media),'attach.png'); } $res = ''; $res .= ''.form::field(array('order['.$count.']'),2,3,$count+1,'position','',false,'title="'.sprintf(__('position of %s'),html::escapeHTML($this->rs->post_title)).'"'). form::hidden(array('dynorder[]','dynorder-'.$count),$count).''. ''. form::checkbox(array('entries[]'),$this->rs->post_id,'','','',!$this->rs->isEditable(),'title="'.__('select this page').'"').''. ''. html::escapeHTML($this->rs->post_title).''. ''.dt::dt2str(__('%Y-%m-%d %H:%M'),$this->rs->post_dt).''. ''.$this->rs->user_id.''. ''.$this->rs->nb_comment.''. ''.$this->rs->nb_trackback.''. ''.$img_status.' '.$selected.' '.$protected.' '.$attach.''. ''; return $res; } } /* Getting pages -------------------------------------------------------- */ $params = array( 'post_type' => 'page' ); $page = !empty($_GET['page']) ? (integer) $_GET['page'] : 1; $nb_per_page = 30; if (!empty($_GET['nb']) && (integer) $_GET['nb'] > 0) { $nb_per_page = (integer) $_GET['nb']; } $params['limit'] = array((($page-1)*$nb_per_page),$nb_per_page); $params['no_content'] = true; $params['order'] = 'post_position ASC, post_title ASC'; try { $pages = $core->blog->getPosts($params); $counter = $core->blog->getPosts($params,true); $post_list = new adminPageList($core,$pages,$counter->f(0)); } catch (Exception $e) { $core->error->add($e->getMessage()); } # Actions combo box $combo_action = array(); if ($core->auth->check('publish,contentadmin',$core->blog->id)) { $combo_action[__('publish')] = 'publish'; $combo_action[__('unpublish')] = 'unpublish'; $combo_action[__('schedule')] = 'schedule'; $combo_action[__('mark as pending')] = 'pending'; } if ($core->auth->check('admin',$core->blog->id)) { $combo_action[__('change author')] = 'author'; } if ($core->auth->check('delete,contentadmin',$core->blog->id)) { $combo_action[__('delete')] = 'delete'; } # --BEHAVIOR-- adminPagesActionsCombo $core->callBehavior('adminPagesActionsCombo',array(&$combo_action)); /* Display -------------------------------------------------------- */ ?> <?php echo __('Pages'); ?> blog->name) => '', ''.__('Pages').'' => '' )); echo '

'.__('New page').'

'; if (!$core->error->flag()) { # Show pages $post_list->display($page,$nb_per_page, '
'. '%s'. '
'. '

'. ''. form::hidden(array('post_type'),'page'). form::hidden(array('redir'),html::escapeHTML($_SERVER['REQUEST_URI'])). $core->formNonce(). '

'. '

'. form::combo('action',$combo_action). '

'. '
'. '
'. '
'); } dcPage::helpBlock('pages'); ?>