コード例 #1
0
ファイル: Theme.php プロジェクト: ppiedaderawnet/concrete5
 public function setCustomStyleObject(\Concrete\Core\StyleCustomizer\Style\ValueList $valueList, $selectedPreset = false, CustomCssRecord $customCssRecord = null)
 {
     $db = Loader::db();
     $db->delete('PageThemeCustomStyles', ['pThemeID' => $this->getThemeID()]);
     $preset = false;
     if ($selectedPreset) {
         $preset = $selectedPreset->getPresetHandle();
     }
     $sccRecordID = 0;
     if ($customCssRecord !== null) {
         $sccRecordID = $customCssRecord->getRecordID();
     }
     $db->insert('PageThemeCustomStyles', ['pThemeID' => $this->getThemeID(), 'sccRecordID' => $sccRecordID, 'preset' => $preset, 'scvlID' => $valueList->getValueListID()]);
     // now we reset all cached css files in this theme
     $sheets = $this->getThemeCustomizableStyleSheets();
     foreach ($sheets as $s) {
         $s->clearOutputFile();
     }
     $scc = new \Concrete\Core\Page\CustomStyle();
     $scc->setThemeID($this->getThemeID());
     $scc->setValueListID($valueList->getValueListID());
     $scc->setPresetHandle($preset);
     $scc->setCustomCssRecordID($sccRecordID);
     return $scc;
 }
コード例 #2
0
ファイル: Page.php プロジェクト: robertdamoc/concrete5
 public function getCustomStyleObject()
 {
     $db = Database::get();
     $row = $db->FetchAssoc('select * from CollectionVersionThemeCustomStyles where cID = ? and cvID = ?', array($this->getCollectionID(), $this->getVersionID()));
     if (isset($row['cID'])) {
         $o = new \Concrete\Core\Page\CustomStyle();
         $o->setThemeID($row['pThemeID']);
         $o->setValueListID($row['scvlID']);
         $o->setPresetHandle($row['preset']);
         $o->setCustomCssRecordID($row['sccRecordID']);
         return $o;
     }
 }