how to create a stylesheet
Posted: Mon May 19, 2014 10:44 pm
In a pre 2.0 setup, one could create a stylesheet with this piece of code.
This does not work anymore in 2.0 beta.
I have searched the 2.0 API docs for more than an hour, but seem to have looked in all the wrong places.
How to rewrite the above code so it will work in 2.0?
Code: Select all
// setup sample stylesheet
$stylesheetops = cmsms()->GetStylesheetOperations();
$fn = cms_join_path(dirname(__FILE__), 'templates', 'stylesheet.css');
if( !$stylesheetops->CheckExistingStylesheetName('nameofstylesheet') && file_exists($fn) )
{
$stylesheet = new Stylesheet();
$stylesheet->name = 'nameofstylesheet';
$stylesheet->value = @file_get_contents($fn);
$stylesheet->media_type = 'screen';
$stylesheetops->InsertStylesheet($stylesheet);
}
I have searched the 2.0 API docs for more than an hour, but seem to have looked in all the wrong places.
How to rewrite the above code so it will work in 2.0?