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?