Ejemplo n.º 1
0
 protected final function EditUrl()
 {
     if ($this->editUrl === null) {
         $contentForm = $this->module->ContentForm();
         if (!$contentForm) {
             $this->editUrl = '';
         } else {
             $args = array('content' => $this->content->GetID());
             $args += $this->EditParams();
             $this->editUrl = BackendRouter::ModuleUrl($contentForm, $args);
         }
     }
     return $this->editUrl;
 }
Ejemplo n.º 2
0
 /**
  * Gets the content's member groups
  * @param Content $content
  * @return Membergroup[] Returns the member groups assigned to the content
  */
 static function ContentMembergroups(Content $content)
 {
     if (!$content->Exists()) {
         return array();
     }
     $sql = Access::SqlBuilder();
     $tblCmg = ContentMembergroup::Schema()->Table();
     $tblMg = Membergroup::Schema()->Table();
     $join = $sql->Join($tblCmg);
     $joinCondition = $sql->Equals($tblCmg->Field('MemberGroup'), $tblMg->Field('ID'));
     $where = $sql->Equals($tblCmg->Field('Content'), $sql->Value($content->GetID()));
     $orderBy = $sql->OrderList($sql->OrderAsc($tblMg->Field('Name')));
     return Membergroup::Schema()->Fetch(false, $where, $orderBy, null, 0, null, $join, JoinType::Inner(), $joinCondition);
 }
Ejemplo n.º 3
0
 /**
  * The last log item that is directly related to the content
  * @param Content $content The content
  * @return LogItem Returns the log item
  */
 static function LastContentLog(Content $content)
 {
     $tblLogContent = LogContent::Schema()->Table();
     $tblLogItem = LogItem::Schema()->Table();
     $sql = Access::SqlBuilder();
     $orderBy = $sql->OrderList($sql->OrderDesc($tblLogItem->Field('Changed')));
     $joinCond = $sql->Equals($tblLogContent->Field('LogItem'), $tblLogItem->Field('ID'));
     $where = $sql->Equals($tblLogContent->Field('Content'), $sql->Value($content->GetID()));
     return LogItem::Schema()->First($where, $orderBy, null, $sql->Join($tblLogContent), JoinType::Inner(), $joinCond);
 }