예제 #1
0
 /**
  * 
  * insert template to templates table
  */
 private static function insertTemplate($title, $filenameHtml, $filenameCss, $type)
 {
     $filepathHtml = self::$path_init_data . "templates/" . $filenameHtml;
     $filepathCss = self::$path_init_data . "templates/" . $filenameCss;
     if (file_exists($filepathHtml) == false) {
         UniteFunctionsBiz::throwError("File {$filepathHtml} not found. Can't init the plugin");
     }
     if (file_exists($filepathCss) == false) {
         UniteFunctionsBiz::throwError("File {$filepathCss} not found. Can't init the plugin");
     }
     $contentHtml = file_get_contents($filepathHtml);
     $contentCss = file_get_contents($filepathCss);
     $tempaltes = new ShowBizTemplate();
     $response = $tempaltes->add($contentHtml, $title, $contentCss, $type, true);
     return $response;
 }