Example #1
0
 public function populateDb()
 {
     $config = (require "/../config/cms.php");
     extract($config);
     //addons
     //laracms
     $addon = new Addons();
     $addon->addon_name = 'laracms';
     $addon->addon_title = 'Core System Addon';
     $addon->icon_image = 'http://laravel.com/assets/img/logo-head.png';
     $addon->version = '1.0.1';
     $addon->author = 'bonweb';
     $addon->url = 'http://www.bonweb.gr';
     $addon->installed = 1;
     $addon->save();
     ClassLoader::addDirectories(array(public_path() . "/addons/laracms/controllers", public_path() . "/addons/laracms/models", public_path() . "/addons/laracms/helpers"));
     //add the screensaver setting
     $setting = new Settings();
     $setting->area = 'backend';
     $setting->section = 'laracms';
     $setting->setting_name = 'screensaver';
     $setting->setting_value = '60000';
     $setting->autoload = 1;
     $setting->save();
     //grid manager
     $addon = new Addons();
     $addon->addon_name = 'grid_manager';
     $addon->addon_title = 'Grid Manager';
     $addon->icon_image = 'http://laravel.com/assets/img/logo-head.png';
     $addon->version = '1.0.1';
     $addon->author = 'bonweb';
     $addon->url = 'http://www.bonweb.gr';
     $addon->installed = 1;
     $addon->save();
     ClassLoader::addDirectories(array(public_path() . "/addons/grid_manager/controllers", public_path() . "/addons/grid_manager/models", public_path() . "/addons/grid_manager/helpers"));
     require_once public_path() . "/addons/grid_manager/func.php";
     Event::fire('backend.addons.saveaddoninfo.grid_manager', array($addon));
     //themes
     $theme = new Themes();
     $theme->theme_name = 'lara';
     $theme->theme_title = 'LaraCMS Default Theme';
     $theme->icon_image = 'http://laravel.com/assets/img/logo-head.png';
     $theme->version = '1.0.1';
     $theme->author = 'bonweb';
     $theme->url = 'http://www.bonweb.gr';
     $theme->installed = 1;
     $theme->active = 1;
     $theme->save();
     //users
     $user = new User();
     $user->firstname = 'John';
     $user->lastname = 'Doe';
     $user->email = $config['admin_email'];
     $user->is_admin = '1';
     $pass = Commoner::generatePass('administrator', $config['admin_email']);
     $user->password = Hash::make($pass);
     $user->save();
     $this->info('Your Password is:' . $pass);
     //add the languages
     $lang = new Languages();
     $lang->code = 'en_US';
     $lang->title = 'English';
     $lang->image = "/uploads/flags/Englang.png";
     $lang->active = 1;
     $lang->save();
     $lang = new Languages();
     $lang->code = 'el_GR';
     $lang->title = 'Greek';
     $lang->image = "/uploads/flags/Greece.png";
     $lang->active = 1;
     $lang->save();
 }
Example #2
0
 function saveThemeinfo($file, $source, $result)
 {
     //read the info and save the data
     $zip = new ZipArchive();
     if ($zip->open($source . $file) !== TRUE) {
     }
     for ($i = 0; $i < $zip->numFiles; $i++) {
         $entry = explode("/", $zip->getNameIndex($i));
         if (end($entry) == 'theme.xml') {
             $xml = $zip->getFromIndex($i);
         }
     }
     $xml = new SimpleXMLElement($xml);
     $theme = new Themes();
     $theme->theme_name = $xml->name;
     $theme->theme_title = $xml->title;
     $theme->icon_image = $xml->image;
     $theme->version = $xml->version;
     $theme->author = $xml->author;
     $theme->url = $xml->url;
     $theme->installed = 0;
     $theme->active = 0;
     Event::fire('backend.themes.savethemeinfo', array($theme));
     $theme->save();
 }