$siteStyleVersion->setAttribute('created', time()); $siteStyleVersion->setAttribute('modified', time()); $siteStyleVersion->store(); $siteStyleDef = new ezcsseSiteStyleDefinition(); $siteStyleDef->setAttribute('sitestyle_id', $siteStyle->attribute('id')); $siteStyleDef->setAttribute('version', $currentVersion + 1); $siteStyleDef->setAttribute('style', $style); $siteStyleDef->store(); } else { $siteStyle = new ezcsseSiteStyle(); $siteStyle->setAttribute('name', 'New style'); $siteStyle->setAttribute('current_version', 1); $siteStyle->setAttribute('selected', 1); $siteStyle->store(); $siteStyleVersion = new ezcsseSiteStyleVersion(); $siteStyleVersion->setAttribute('sitestyle_id', $siteStyle->attribute('id')); $siteStyleVersion->setAttribute('version', 1); $siteStyleVersion->setAttribute('created', time()); $siteStyleVersion->setAttribute('modified', time()); $siteStyleVersion->store(); $siteStyleDef = new ezcsseSiteStyleDefinition(); $siteStyleDef->setAttribute('sitestyle_id', $siteStyle->attribute('id')); $siteStyleDef->setAttribute('version', 1); $siteStyleDef->store(); } $tpl = templateInit(); $ini = eZINI::instance(); $http = eZHTTPTool::instance(); $contentObject = $node->attribute('object'); $nodeResult = eZNodeviewfunctions::generateNodeViewData($tpl, $node, $contentObject, $languageCode, 'full', 0); // Generate a unique cache key for use in cache-blocks in pagelayout.tpl.
/** * Creates a new site style with given name * * @static */ public static function createSiteStyle() { $params = self::getPostParams(); $siteStyleParam = isset($params['site_style']) ? $params['site_style'] : array(); $siteStyleName = isset($siteStyleParam['name']) ? $siteStyleParam['name'] : null; $siteStyle = new ezcsseSiteStyle(); $siteStyle->setAttribute('name', $siteStyleName); $siteStyle->setAttribute('current_version', 1); $siteStyle->setAttribute('selected', 0); $siteStyle->store(); $siteStyleVersion = new ezcsseSiteStyleVersion(); $siteStyleVersion->setAttribute('sitestyle_id', $siteStyle->attribute('id')); $siteStyleVersion->setAttribute('version', 1); $siteStyleVersion->setAttribute('created', time()); $siteStyleVersion->setAttribute('modified', time()); $siteStyleVersion->store(); $siteStyleDef = new ezcsseSiteStyleDefinition(); $siteStyleDef->setAttribute('sitestyle_id', $siteStyle->attribute('id')); $siteStyleDef->setAttribute('version', 1); $siteStyleDef->store(); }