Esempio n. 1
0
 /**
  * Get status of item
  *
  * Statuses:
  * - published
  * - deprecated
  * - protected
  * - private
  * - draft
  *
  * @param array Params
  */
 function get_status($params = array())
 {
     // Make sure we are not missing any param:
     $params = array_merge(array('before' => '', 'after' => '', 'format' => 'htmlbody', 'class' => ''), $params);
     $r = $params['before'];
     switch ($params['format']) {
         case 'raw':
             $r .= $this->get_status_raw();
             break;
         case 'styled':
             // DEPRECATED: instead use something like: $Item->format_status( array(	'template' => '<div class="evo_status__banner evo_status__$status$">$status_title$</div>' ) );
             $r .= get_styled_status($this->status, $this->get('t_status'), $params['class']);
             break;
         default:
             // other formats
             $r .= format_to_output($this->get('t_status'), $params['format']);
             break;
     }
     $r .= $params['after'];
     return $r;
 }
Esempio n. 2
0
 /**
  * Template function: display all statuses and only one is visible by css class name
  *
  * Statuses:
  * - published
  * - community
  * - protected
  * - review
  * - private
  * - draft
  */
 function statuses()
 {
     $statuses = get_visibility_statuses('', array('deprecated', 'redirected', 'trash'));
     foreach ($statuses as $status => $title) {
         echo get_styled_status($status, $title);
     }
 }
Esempio n. 3
0
 /**
  * Get status of item
  *
  * Statuses:
  * - published
  * - deprecated
  * - protected
  * - private
  * - draft
  *
  * @param array Params
  */
 function get_status($params = array())
 {
     // Make sure we are not missing any param:
     $params = array_merge(array('before' => '', 'after' => '', 'format' => 'htmlbody'), $params);
     $r = $params['before'];
     switch ($params['format']) {
         case 'raw':
             $r .= $this->get_status_raw();
             break;
         case 'styled':
             $r .= get_styled_status($this->status, $this->get('t_status'));
             break;
         default:
             $r .= format_to_output($this->get('t_status'), $params['format']);
             break;
     }
     $r .= $params['after'];
     return $r;
 }