public static function handleRequest()
 {
     $GLOBALS['Session']->requireAuthentication();
     if (static::peekPath() == 'json') {
         static::$responseMode = static::shiftPath();
     }
     return static::respond('drafts', array('success' => true, 'data' => AbstractContent::getAllByWhere(array('AuthorID' => $GLOBALS['Session']->PersonID, 'Status = "Draft" OR Published > CURRENT_TIMESTAMP'))));
 }
 /**
  * @param Message|string $msg A Message object, or a message key.
  * @param string[] $params An optional array of message parameters.
  */
 public function __construct($msg, $params = null)
 {
     # XXX: messages may be wikitext, html or plain text! and maybe even something else entirely.
     parent::__construct(CONTENT_MODEL_WIKITEXT);
     if (is_string($msg)) {
         $this->mMessage = wfMessage($msg);
     } else {
         $this->mMessage = clone $msg;
     }
     if ($params) {
         $this->mMessage = $this->mMessage->params($params);
     }
 }
 public function __construct($data)
 {
     parent::__construct("testing");
     $this->data = $data;
 }
 /**
  * @see Content::convert()
  *
  * This implementation provides lossless conversion between content models based
  * on TextContent.
  *
  * @param String  $toModel the desired content model, use the CONTENT_MODEL_XXX flags.
  * @param String  $lossy flag, set to "lossy" to allow lossy conversion. If lossy conversion is
  * not allowed, full round-trip conversion is expected to work without losing information.
  *
  * @return Content|bool A content object with the content model $toModel, or false if
  * that conversion is not supported.
  */
 public function convert($toModel, $lossy = '')
 {
     $converted = parent::convert($toModel, $lossy);
     if ($converted !== false) {
         return $converted;
     }
     $toHandler = ContentHandler::getForModelID($toModel);
     if ($toHandler instanceof TextContentHandler) {
         //NOTE: ignore content serialization format - it's just text anyway.
         $text = $this->getNativeData();
         $converted = $toHandler->unserializeContent($text);
     }
     return $converted;
 }
Beispiel #5
0
 /**
  * 将每行的值压入堆栈
  *
  * @access public
  * @param array $value 每行的值
  * @return array
  */
 public function push(array $value)
 {
     $value = $this->filter($value);
     return parent::push($value);
 }
 public function __construct($contentModel = CONTENT_MODEL_FLOW_BOARD, UUID $workflowId = null)
 {
     parent::__construct($contentModel);
     $this->workflowId = $workflowId;
 }
Beispiel #7
0
 public static function getAllPublishedByContextObject(ActiveRecord $Context, $options = array())
 {
     $options = array_merge(array('conditions' => array()), $options);
     $options['conditions']['Class'] = __CLASS__;
     return parent::getAllPublishedByContextObject($Context, $options);
 }