Exemplo n.º 1
0
Arquivo: http.php Projeto: dawaa/taco
 public function installTheme()
 {
     $themeDirectory = $_POST['theme-dir'];
     $themeDirectoryPath = THEMESPATH . DS . $themeDirectory . DS;
     $Theme = new \Core\System\Classes\Theme($this->db);
     // Make sure the directory exists
     if (is_dir($themeDirectoryPath)) {
         $theme_data = $Theme->getThemeData($themeDirectory);
         if ($theme_data !== null) {
             $themeSlug = $theme_data['Name'] ? $theme_data['Name'] : $themeDirectory;
             $array = array("is_active" => 0, "theme_name" => $themeSlug, "theme_description" => $theme_data['Description']);
         } else {
             $array = array("is_active" => 0, "theme_name" => $themeDirectory, "theme_description" => "");
         }
         $this->db->insert("pfx_themes", $array);
     }
     exit;
 }
Exemplo n.º 2
0
Arquivo: index.php Projeto: dawaa/taco
        echo 'Content path is not set correctly. Open and edit following file: ' . SELF;
        die;
    }
    define('CONTENTPATH', BASEPATH . $content_path . DS);
}
require_once BASEPATH . 'database/connect.php';
// instantiate database connection
require_once BASEPATH . 'system/Autoload.php';
// get our autoloading up n running, yo
/**
* Check if we can find our Theme-folder.
* Later on check if we can find our Templates-folder inside our Theme-folder
*
* Else we will output an error.
*/
$theme = new Core\System\Classes\Theme($db);
$theme_dirname = $theme->getThemeDirName();
$theme_path = CONTENTPATH . 'themes' . DS . $theme_dirname . DS;
// Can we locate our theme folder
if (is_dir($theme_path)) {
    if (empty($template_path)) {
        $template_path = $theme_path . DS . 'templates' . DS;
    } else {
        $template_path = $theme_path . DS . $template_path . DS;
    }
    // If we can't find our template folder inside our theme folder, log an error.
    if (!is_dir($template_path)) {
        echo 'Template path is not set correctly. Open and edit following file: ' . SELF;
        die;
    }
} else {