コード例 #1
0
ファイル: CustomStyle.php プロジェクト: ceko/concrete5-1
 public function getCustomCssRecord()
 {
     if ($this->sccRecordID > 0) {
         $css = CustomCssRecord::getByID($this->sccRecordID);
         return $css;
     }
 }
コード例 #2
0
 public function testCustomStyleRecord()
 {
     $record = new \Concrete\Core\StyleCustomizer\CustomCssRecord();
     $record->setValue('body { display: none; }');
     $record->save();
     $this->assertEquals($record->getValue(), 'body { display: none; }');
     $this->assertEquals($record->getRecordID(), 1);
     $rec2 = \Concrete\Core\StyleCustomizer\CustomCssRecord::getByID(1);
     $this->assertEquals($record, $rec2);
 }
コード例 #3
0
ファイル: css.php プロジェクト: yakamoz-fang/concrete
 public function view()
 {
     $this->requireAsset('ace');
     $sccRecordID = 0;
     $value = '';
     if ($this->request->query->has('sccRecordID')) {
         $sccRecord = CustomCssRecord::getByID($this->request->query->get('sccRecordID'));
         if (is_object($sccRecord)) {
             $value = $sccRecord->getValue();
             $sccRecordID = $sccRecord->getRecordID();
         }
     }
     $this->set('value', $value);
     $this->set('sccRecordID', $sccRecordID);
 }
コード例 #4
0
ファイル: customize.php プロジェクト: ngreimel/kovent
 public function apply_to_page($pThemeID)
 {
     if ($this->validateAction()) {
         $vl = $this->getValueListFromRequest($pThemeID);
         $pt = PageTheme::getByID($pThemeID);
         $vl->save();
         $sccRecord = false;
         if ($this->request->request->has('sccRecordID')) {
             $sccRecord = \Concrete\Core\StyleCustomizer\CustomCssRecord::getByID($this->request->request->get('sccRecordID'));
         }
         $preset = false;
         if ($this->request->request->has('handle')) {
             $preset = $pt->getThemeCustomizablePreset($this->request->request->get('handle'));
         }
         $nvc = $this->page->getVersionToModify();
         $nvc->setCustomStyleObject($pt, $vl, $preset, $sccRecord);
         $r = new PageEditResponse();
         $r->setPage($this->page);
         $r->setRedirectURL(\URL::to($this->page));
         $r->outputJSON();
     }
 }