$styleLayouts = $gBitThemes->getStyleLayouts(); $gBitSmarty->assign_by_ref("styleLayouts", $styleLayouts); if (!empty($_REQUEST["site_style_layout"])) { $gBitSystem->storeConfig('site_style_layout', $_REQUEST["site_style_layout"] != 'remove' ? $_REQUEST["site_style_layout"] : NULL, THEMES_PKG_NAME); } // load cascader $gCascader = new Cascader($_REQUEST); if (!$gCascader->load()) { $feedback['error'] = $gCascader->mErrors; } // Make sure gCascader is avalable in the templates $gBitSmarty->assign_by_ref('gCascader', $gCascader); // Process form requests // Remove all scheme files if (!empty($_REQUEST['clear_all_styles'])) { unlink_r(LibertyAttachable::getStoragePath()); $gBitSystem->storeConfig('cascader_style', NULL); } // create a css file based on the user specifications if (!empty($_REQUEST['create_style'])) { $cascaderCss = $gCascader->createHeader(); $cascaderCss .= $gCascader->createCss($_REQUEST['cascader']); if ($cssUrl = $gCascader->writeCss($cascaderCss)) { $feedback['success'] = tra("The css file was stored to") . ": " . $cssUrl; } else { $feedback['error'] = tra("There was a problem storing your custom css file."); } $gBitSystem->storeConfig('cascader_style', $cssUrl); } // apply an existing style if (!empty($_REQUEST['apply_style'])) {
function getStoragePath($pSubDir = NULL) { return LibertyAttachable::getStoragePath($pSubDir, NULL, PACKAGER_PKG_NAME); }
/** * remove a specific css file * * @param array $pStyleName Name of the file * @access public * @return TRUE on success, FALSE on failure - mErrors will contain reason for failure */ function expunge($pStyleName) { $path = LibertyAttachable::getStoragePath(); if (is_file($path . $pStyleName)) { unlink($path . $pStyleName); return TRUE; } return FALSE; }