コード例 #1
0
 /**
  * Private constructor
  *
  * @return void
  */
 private function __construct()
 {
     // Create database table for form submission logs
     register_activation_hook(CGIT_POSTMAN_PLUGIN_FILE, [$this, 'createLogTable']);
     // Initialize log spooler
     Lumberjack::getInstance();
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function liveChildren($showAll = false, $onlyDeletedFromStage = false)
 {
     $staged = parent::liveChildren($showAll, $onlyDeletedFromStage);
     if (!$this->shouldFilter() && $this->isBlog() && !Permission::check('VIEW_DRAFT_CONTENT')) {
         $dataQuery = $staged->dataQuery()->innerJoin('BlogPost', '"BlogPost_Live"."ID" = "SiteTree_Live"."ID"')->where(sprintf('"PublishDate" < \'%s\'', Convert::raw2sql(SS_Datetime::now())));
         $staged = $staged->setDataQuery($dataQuery);
     }
     return $staged;
 }
コード例 #3
0
 /**
  * Augments (@link Hierarchy::liveChildren()}
  *
  * @param $staged DataList
  * @param $showAll boolean
  **/
 public function liveChildren($showAll = false, $onlyDeletedFromStage = false)
 {
     $staged = parent::liveChildren($showAll, $onlyDeletedFromStage);
     if (!$this->shouldFilter() && in_array(get_class($this->owner), ClassInfo::subClassesFor("Blog")) && !Permission::check("VIEW_DRAFT_CONTENT")) {
         // Filter publish posts
         $dataQuery = $staged->dataQuery()->innerJoin("BlogPost", '"BlogPost_Live"."ID" = "SiteTree"_"Live"."ID"')->where('"PublishDate" < \'' . Convert::raw2sql(SS_Datetime::now()) . '\'');
         $staged = $staged->setDataQuery($dataQuery);
     }
     return $staged;
 }