contributions/css.yaml/install/install.php File Reference
Go to the source code of this file.
Functions |
|
css_yaml_install () |
Function Documentation
css_yaml_install | ( | ) |
Definition at line 2 of file install.php.
00002 { 00003 $ret = new Status(); 00004 Load::components('systemupdateinstaller'); 00005 00006 // Check if there is a YAML file installed already 00007 $do_copy = true; 00008 try { 00009 $current_page_tpl = TemplatePathResolver::resolve('page'); 00010 $c = file_get_contents($current_page_tpl); 00011 if (strpos($c, '##Installed by CSS.YAML##') !== false) { 00012 $do_copy = false; 00013 } 00014 } 00015 catch (Exception $ex) { 00016 // No template found... Ignore 00017 } 00018 00019 if ($do_copy) { 00020 $root = Load::get_module_dir('css.yaml') . 'data/' . Config::get_value(ConfigYAML::YAML_VERSION) . '/'; 00021 $ret->merge(SystemUpdateInstaller::copy_to_app('view/templates/default/', $root . 'template/', array('page.tpl.php'), SystemUpdateInstaller::COPY_OVERWRITE)); 00022 } 00023 return $ret; 00024 }