コード例 #1
0
 /**
  * Execute the console command.
  * @return void
  */
 public function fire()
 {
     $this->info('Initializing npm, bower and some boilerplates');
     // copiar templates
     $path_source = plugins_path('genius/elixir/assets/template/');
     $path_destination = base_path('/');
     $vars = ['{{theme}}' => Theme::getActiveTheme()->getDirName(), '{{project}}' => str_slug(BrandSettings::get('app_name'))];
     $fileSystem = new Filesystem();
     foreach ($fileSystem->allFiles($path_source) as $file) {
         if (!$fileSystem->isDirectory($path_destination . $file->getRelativePath())) {
             $fileSystem->makeDirectory($path_destination . $file->getRelativePath(), 0777, true);
         }
         $fileSystem->put($path_destination . $file->getRelativePathname(), str_replace(array_keys($vars), array_values($vars), $fileSystem->get($path_source . $file->getRelativePathname())));
     }
     $this->info('... initial setup is ok!');
     $this->info('Installing npm... this can take several minutes!');
     // instalar NPM
     system("cd '{$path_destination}' && npm install");
     $this->info('... node components is ok!');
     $this->info('Installing bower... this will no longer take as!');
     // instalar NPM
     system("cd '{$path_destination}' && bower install");
     $this->info('... bower components is ok!');
     $this->info('Now... edit the /gulpfile.js as you wish and edit your assets at/ resources directory... that\'s is!');
 }
コード例 #2
0
 /**
  * Execute the console command.
  * @return void
  */
 public function fire()
 {
     $base_path = base_path('');
     $this->info('Dependencies installing begins here! (plugin:install)');
     // DEPENDENCIES
     foreach (['RainLab.Translate', 'Flynsarmy.IdeHelper', 'BnB.ScaffoldTranslation', 'October.Drivers', 'RainLab.GoogleAnalytics', 'Genius.StorageClear'] as $required) {
         $this->info('Installing: ' . $required);
         Artisan::call("plugin:install", ['name' => $required]);
     }
     $this->info('Dependencies installed!');
     // THEME
     $this->info('Installing: oc-genius-theme');
     system("cd '{$base_path}' && git clone https://github.com/estudiogenius/oc-genius-theme themes/genius");
     Theme::setActiveTheme('genius');
     // ELIXIR
     $this->info('Installing: oc-genius-elixir');
     system("cd '{$base_path}' && git clone https://github.com/estudiogenius/oc-genius-elixir plugins/genius/elixir");
     // FORMS
     $this->info('Installing: oc-genius-forms');
     system("cd '{$base_path}' && git clone https://github.com/estudiogenius/oc-genius-forms plugins/genius/forms");
     // BACKUP
     $this->info('Installing: oc-genius-backup');
     system("cd '{$base_path}' && git clone https://github.com/estudiogenius/oc-genius-backup plugins/genius/backup");
     // GOOGLE ANALYTICS
     $this->info('Initial setup: AnalytcsSettings');
     if (!AnalytcsSettings::get('project_name')) {
         AnalytcsSettings::create(['project_name' => 'API Project', 'client_id' => '979078159189-8afk8nn2las4vk1krbv8t946qfk540up.apps.googleusercontent.com', 'app_email' => '*****@*****.**', 'profile_id' => '112409305', 'tracking_id' => 'UA-29856398-24', 'domain_name' => 'retrans.srv.br'])->gapi_key()->add(File::create(['data' => plugins_path('genius/base/assets/genius-analytics.p12')]));
     }
     // EMAIL
     $this->info('Initial setup: MailSettings');
     if (!MailSettings::get('mandrill_secret')) {
         MailSettings::create(['send_mode' => 'mandrill', 'sender_name' => 'Genius Soluções Web', 'sender_email' => '*****@*****.**', 'mandrill_secret' => 't27R2C15NPnZ8tzBrIIFTA']);
     }
     // BRAND
     $this->info('Initial setup: BrandSettings');
     if (!BrandSettings::get('app_init')) {
         BrandSettings::create(['app_name' => 'Genius Soluções Web', 'app_tagline' => 'powered by Genius', "primary_color_light" => "#e67e22", "primary_color_dark" => "#d35400", "secondary_color_light" => "#34495e", "secondary_color_dark" => "#2b3e50", "custom_css" => "", 'app_init' => true])->logo()->add(File::create(['data' => plugins_path('genius/base/assets/genius-logo.png')]));
     }
     // USUARIO BASE
     $this->info('Initial setup: User');
     $user = User::find(1);
     if (!$user->last_name) {
         $user->update(['first_name' => 'Genius', 'last_name' => 'Soluções Web', 'login' => 'genius', 'email' => '*****@*****.**', 'password' => 'genius', 'password_confirmation' => 'genius']);
         $user->avatar()->add(File::create(['data' => plugins_path('genius/base/assets/genius-avatar.jpg')]));
     }
     $this->info('Genius.Base is ready to rock!');
     $this->info('');
     $this->info('For Laravel Elixir setup run: php artisan elixir:init');
 }
コード例 #3
0
 /**
  * Update the settings fields of other models if the settings of this one is updated.
  * @return null 
  */
 public function afterSave()
 {
     if (count($this->getDirty()) > 0) {
         \Backend\Models\BrandSettings::set(['app_name' => $this->get('name'), 'app_tagline' => $this->get('full_name')]);
         if (class_exists('\\AnandPatel\\SeoExtension\\models\\Settings')) {
             $seo_settings = \AnandPatel\SeoExtension\models\Settings::instance();
             switch ($seo_settings->title_position) {
                 case 'prefix':
                     $seo_settings->title = $this->get('name') . ' |';
                 case 'suffix':
                     $seo_settings->title = '| ' . $this->get('name');
             }
             $seo_settings->save();
         }
     }
 }
コード例 #4
0
ファイル: Basket.php プロジェクト: Hasnayeen/shohoranno
 public function onCheckout()
 {
     if (!$this->stockCheck()) {
         return $this->redirectBackWithRemovedError();
     }
     $content = Cart::content()->toArray();
     $total = Cart::total();
     $this->formatPrices($content, $total);
     Mail::sendTo(post('email'), 'feegleweb.octoshoplite::mail.orderconfirm', ['admin' => false, 'name' => post('first_name'), 'site' => BrandSettings::get('app_name'), 'items' => $content, 'total' => $total]);
     Mail::sendTo($this->recipientEmail, 'feegleweb.octoshoplite::mail.orderconfirm_admin', ['admin' => true, 'name' => $this->recipientName, 'address' => implode('<br>', [post('first_name') . ' ' . post('last_name'), post('address'), post('town'), post('county'), post('postcode')]), 'site' => BrandSettings::get('app_name'), 'items' => $content, 'total' => $total]);
     return Redirect::to('/');
 }
コード例 #5
0
<?php

/**
 * @author Alex Carrega <*****@*****.**>
 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
 */
/*
 * Add route to the logo.
 * Adds custom routes.
 * @param Illuminate\Http\Request $request
 * @return null
 */
App::before(function ($request) {
    Route::get('/logo', function () {
        $response = Response::make(\Backend\Models\BrandSettings::instance()->logo->output(), 200);
        $response->header('Content-Type', 'image/png');
        return $response;
    });
    $ctrl = new \Cms\Classes\Controller();
    foreach (\AxC\DataManagement\Models\Route::published() as $route) {
        $language[] = (object) ['code' => $route->language];
        if ($route->language == '') {
            $language = array_merge($language, \RainLab\Translate\Models\Locale::get(['code'])->all());
        }
        foreach ($language as $l) {
            Route::any("{$l->code}/{$route->path}", function () use($ctrl, $route) {
                return $ctrl->run($route->page);
            });
        }
    }
});
コード例 #6
0
 /**
  * Add data to DB scheme
  * @return null;
  */
 public function run()
 {
     Settings::set('name', 'Seldac');
     Settings::set('full_name', 'Seldac Servizi S.r.L.');
     Settings::set('slogan', 'The answer to the administrative needs of all companies, small and medium-sized businesses, professionals and associations.');
     Settings::set('about', implode("\n", ['provides high-level advice to companies, accompanying step by step their customers in the intricate field of taxation.', 'The service of electronic data processing accounting allows to fulfill all the formalities required by law.', 'Our customer can resolve the related tasks because the service is managed by experienced staff', 'through the use of one of the most advanced management software as ZUCCHETTI.']));
     Settings::set('address_street_name', 'via Felice Cavallotti');
     Settings::set('address_street_number', '128');
     Settings::set('address_street_int', '3');
     Settings::set('address_zip', '15067');
     Settings::set('address_city', 'Novi Ligure');
     Settings::set('address_province', 'AL');
     Settings::set('address_country', 'IT');
     Settings::set('vat', '02254830066');
     Settings::set('rui_section', 'E');
     Settings::set('rui_number', 'E000147232');
     Settings::set('rui_date', '10/04/2007');
     Settings::set('mc_address_street_name', 'via Felice Cavallotti');
     Settings::set('mc_address_street_number', '128');
     Settings::set('mc_address_street_int', '5');
     Settings::set('mc_address_zip', '15067');
     Settings::set('mc_address_city', 'Novi Ligure');
     Settings::set('mc_address_province', 'AL');
     Settings::set('mc_address_country', 'IT');
     Settings::set('mc_nin', 'CSRMRC64P02D612A');
     Settings::set('mc_vat', '05110830485');
     AddThisSettings::set('pubid', 'ra-5481b79425aef103');
     SegmentSettings::set('write_key', 'qufrprcjgq');
     $ga_settings = GoogleAnalyticsSettings::instance();
     $ga_settings->project_name = 'seldac';
     $ga_settings->client_id = '284098878834-asjihnigkqg3ikl5kiqsgked7f2j3nf4.apps.googleusercontent.com';
     $ga_settings->app_email = '*****@*****.**';
     $ga_settings->profile_id = '63908586';
     $ga_settings->tracking_id = 'UA-34732651-1';
     $ga_settings->domain_name = 'seldac';
     $ga_settings->save();
     $mail_settings = MailSettings::instance();
     $mail_settings->send_mode = 'smtp';
     $mail_settings->sender_name = 'Seldac Servizi S.r.L.';
     $mail_settings->sender_email = '*****@*****.**';
     $mail_settings->smtp_address = 'smtp.aruba.it';
     $mail_settings->smtp_port = '465';
     $mail_settings->smtp_user = '******';
     $mail_settings->smtp_password = '******';
     $mail_settings->smtp_authorization = '1';
     $mail_settings->smtp_ssl = '1';
     $mail_settings->save();
     $seo_extension_settings = SeoExtensionSettings::instance();
     $seo_extension_settings->enable_title = '1';
     $seo_extension_settings->enable_canonical_url = '1';
     $seo_extension_settings->title = '| Seldac';
     $seo_extension_settings->title_position = 'suffix';
     $seo_extension_settings->other_tags = "<meta name=\"author\" content=\"Alex Carrega (AxC - http:\\/\\/www.alexcarrega.com)\">\r\n<meta name=\"apple-mobile-web-app-capable\" content=\"yes\" \\/>\r\n<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\" \\/>\r\n<meta name=\"description\" content=\"Contact page\" \\/>\r\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">";
     $seo_extension_settings->save();
     $brand_settings = BrandSettings::instance();
     $brand_settings->app_name = 'Seldac';
     $brand_settings->app_tagline = 'Seldac Servizi S.r.L.';
     $brand_settings->primary_color_light = '#de6b10';
     $brand_settings->primary_color_dark = '#DAA520';
     $brand_settings->secondary_color_light = '#F0E68C';
     $brand_settings->secondary_color_dark = '#B22222';
     $brand_settings->save();
     $recaptcha_settings = reCAPTCHASettings::instance();
     $recaptcha_settings->public_key = '6LfF0uwSAAAAAL4L5_sQ9aDiCn8PzMd0rStSSH5N';
     $recaptcha_settings->private_key = '6LfF0uwSAAAAAOdiygwACNXT34u5NpD0ndHXn9Jn';
     $recaptcha_settings->save();
     // @p-color: #58585a;
     // @s-color: #de6b10;
     // @bg-color: #e6e7e8;
     // @i-color: #DAA520;
     // @w-color: #F0E68C;
     // @d-color: #B22222;
 }
コード例 #7
0
 public function defineProperties()
 {
     return ['element' => ['title' => 'Elemento', 'description' => 'ID do elemento que receberá o mapa', 'default' => 'map', 'type' => 'string'], 'title' => ['title' => 'Título', 'description' => 'Nome que aparecerá no box de identificação', 'default' => BrandSettings::instance()->app_name, 'type' => 'string'], 'description' => ['title' => 'Descrição', 'description' => 'Descrição do endereço / contatos da empresa (HTML)', 'type' => 'string'], 'latitude' => ['title' => 'Latitude', 'description' => 'Latitude do marcador de endereço', 'default' => '-27.574771', 'type' => 'string'], 'longitude' => ['title' => 'Longitude', 'description' => 'Longitude do marcador de endereço', 'default' => '-48.514254', 'type' => 'string'], 'zoom' => ['title' => 'Zoom', 'description' => 'Distancia do zoom do mapa', 'default' => '14', 'type' => 'string']];
 }