Beispiel #1
0
 public function onRun()
 {
     $css = ['assets/css/magnific-popup.css'];
     $js = ['assets/js/jquery.magnific-popup.min.js', 'assets/js/magnific.js'];
     $this->addCss(CombineAssets::combine($css, plugins_path() . '/mohsin/magnificgallery'));
     $this->addJs(CombineAssets::combine($js, plugins_path() . '/mohsin/magnificgallery'));
 }
Beispiel #2
0
 /**
  * @return EditorModel
  */
 public function formCreateModelObject()
 {
     $model = new EditorModel();
     $configuration = file_get_contents(plugins_path('adrenth/tinymce/assets/js/default.tinymce.init.js'));
     $model->setAttribute('configuration', $configuration);
     return $model;
 }
Beispiel #3
0
 public function onSignup()
 {
     $settings = Settings::instance();
     if (!$settings->api_key) {
         throw new ApplicationException('MailChimp API key is not configured.');
     }
     /*
      * Validate input
      */
     $data = post();
     $rules = ['email' => 'required|email|min:2|max:64'];
     $validation = Validator::make($data, $rules);
     if ($validation->fails()) {
         throw new ValidationException($validation);
     }
     /*
      * Sign up to Mailchimp via the API
      */
     require_once plugins_path() . '/rainlab/mailchimp/vendor/MCAPI.class.php';
     $api = new \MCAPI($settings->api_key);
     $this->page['error'] = null;
     $mergeVars = '';
     if (isset($data['merge']) && is_array($data['merge']) && count($data['merge'])) {
         $mergeVars = $data['merge'];
     }
     if ($api->listSubscribe($this->property('list'), post('email'), $mergeVars) !== true) {
         $this->page['error'] = $api->errorMessage;
     }
 }
 public function onRun()
 {
     $css = ['assets/css/magnific-popup.css'];
     $js = ['assets/js/masonry.pkgd.min.js', 'assets/js/magnific-popup.min.js', 'assets/js/magnific-init.js'];
     $this->addCss(CombineAssets::combine($css, plugins_path() . '/umar/masongallery'));
     $this->addJs(CombineAssets::combine($js, plugins_path() . '/umar/masongallery'));
 }
 /**
  * Execute the console command.
  */
 public function fire()
 {
     /*
      * Extract the author and name from the plugin code
      */
     $pluginCode = $this->argument('pluginCode');
     $parts = explode('.', $pluginCode);
     $pluginName = array_pop($parts);
     $authorName = array_pop($parts);
     $destinationPath = plugins_path() . '/' . strtolower($authorName) . '/' . strtolower($pluginName);
     $widgetName = $this->argument('widgetName');
     $vars = ['name' => $widgetName, 'author' => $authorName, 'plugin' => $pluginName];
     Widget::make($destinationPath, $vars, $this->option('force'));
     $vars['plugin'] = $vars['name'];
     $langPrefix = strtolower($authorName) . '.' . strtolower($pluginName) . '::lang.';
     $defaultLocale = Lang::getLocale();
     $locales = TranslationScanner::loadPluginLocales();
     foreach ($locales as $locale) {
         Lang::setLocale($locale);
         $vars[$locale] = [$langPrefix . 'plugin.name' => trans('bnb.scaffoldtranslation::lang.defaults.widget.name', ['name' => $pluginName]), $langPrefix . 'plugin.description' => trans('bnb.scaffoldtranslation::lang.defaults.widget.description')];
     }
     Lang::setLocale($defaultLocale);
     TranslationScanner::instance()->with($vars)->scan($destinationPath . '/widgets');
     $this->info(sprintf('Successfully generated Form Widget named "%s"', $widgetName));
 }
Beispiel #6
0
 public function getModelatorOptions($keyValue = null)
 {
     $models = $out = [];
     $i = 0;
     $authors = File::directories(plugins_path());
     foreach ($authors as $author) {
         foreach (File::directories($author) as $plugin) {
             foreach (File::files($plugin . DIRECTORY_SEPARATOR . 'models') as $modelFile) {
                 # All links in the LinkCheck plugin table are broken. Skip.
                 $linkCheckPluginPath = plugins_path() . DIRECTORY_SEPARATOR . 'bombozama' . DIRECTORY_SEPARATOR . 'linkcheck';
                 if ($plugin == $linkCheckPluginPath) {
                     continue;
                 }
                 $models[] = Helper::getFullClassNameFromFile((string) $modelFile);
             }
         }
     }
     foreach ($models as $model) {
         $object = new $model();
         foreach (Schema::getColumnListing($object->table) as $column) {
             $type = DB::connection()->getDoctrineColumn($object->table, $column)->getType()->getName();
             if (in_array($type, ['string', 'text'])) {
                 $out[$model . '::' . $column] = $model . '::' . $column;
             }
         }
     }
     return $out;
 }
 /**
  * Finds and serves the requested backend controller.
  * If the controller cannot be found, returns the Cms page with the URL /404.
  * If the /404 page doesn't exist, returns the system 404 page.
  * @param string $url Specifies the requested page URL.
  * If the parameter is omitted, the current URL used.
  * @return string Returns the processed page content.
  */
 public function run($url = null)
 {
     $params = RouterHelper::segmentizeUrl($url);
     /*
      * Look for a Module controller
      */
     $module = isset($params[0]) ? $params[0] : 'backend';
     $controller = isset($params[1]) ? $params[1] : 'index';
     self::$action = $action = isset($params[2]) ? $this->parseAction($params[2]) : 'index';
     self::$params = $controllerParams = array_slice($params, 3);
     $controllerClass = '\\' . $module . '\\Controllers\\' . $controller;
     if ($controllerObj = $this->findController($controllerClass, $action, base_path() . '/modules')) {
         return $controllerObj->run($action, $controllerParams);
     }
     /*
      * Look for a Plugin controller
      */
     if (count($params) >= 2) {
         list($author, $plugin) = $params;
         $controller = isset($params[2]) ? $params[2] : 'index';
         self::$action = $action = isset($params[3]) ? $this->parseAction($params[3]) : 'index';
         self::$params = $controllerParams = array_slice($params, 4);
         $controllerClass = '\\' . $author . '\\' . $plugin . '\\Controllers\\' . $controller;
         if ($controllerObj = $this->findController($controllerClass, $action, plugins_path())) {
             return $controllerObj->run($action, $controllerParams);
         }
     }
     /*
      * Fall back on Cms controller
      */
     return App::make('Cms\\Classes\\Controller')->run($url);
 }
 /**
  * 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!');
 }
 public function run()
 {
     $driver = Driver::firstOrCreate(['name' => 'U.S. Postal Service', 'type' => 'shipping', 'class' => 'Bedard\\USPS\\Classes\\USPS', 'is_configurable' => true, 'is_default' => false]);
     $logo = new File();
     $logo->fromFile(plugins_path('bedard/usps/assets/images/usps.png'));
     $logo->save();
     $driver->image()->add($logo);
 }
 function credentials()
 {
     if (Session::get('ADMINER_AUTOLOGIN') === true) {
         require_once plugins_path() . '/martin/adminer/classes/OctoberAdminerHelper.php';
         $connection = Martin\Adminer\Classes\OctoberAdminerHelper::getAutologinParams();
         if ($connection['driver'] == 'mysql') {
             return [$server, $connection['username'], $connection['password']];
         }
     }
 }
 /**
  * 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');
 }
 /**
  * Execute the console command.
  */
 public function fire()
 {
     /*
      * Extract the author and name from the plugin code
      */
     $pluginCode = $this->argument('pluginCode');
     $parts = explode('.', $pluginCode);
     $pluginName = array_pop($parts);
     $authorName = array_pop($parts);
     $destinationPath = plugins_path() . '/' . strtolower($authorName) . '/' . strtolower($pluginName);
     $widgetName = $this->argument('widgetName');
     $vars = ['name' => $widgetName, 'author' => $authorName, 'plugin' => $pluginName];
     FormWidget::make($destinationPath, $vars, $this->option('force'));
     $this->info(sprintf('Successfully generated Form Widget named "%s"', $widgetName));
 }
 /**
  * Extend the CMS form fields
  *
  * @param   Form        $form
  */
 public static function extendFormFields(Form $form)
 {
     // Add a hidden field for the campaign id
     if ($campaign = Campaign::whereCmsObject($form)->first()) {
         $form->secondaryTabs['fields']['splitter[id]'] = ['tab' => 'bedard.splitter::lang.campaigns.cmsTab', 'default' => $campaign->id, 'cssClass' => 'hidden'];
         $form->model->splitter = $campaign->toArray();
     }
     // Add the remaining fields from our campaign form definition
     $yaml = new Yaml();
     $content = $yaml->parseFile(plugins_path('bedard/splitter/models/campaign/fields.yaml'));
     $fields = $content['secondaryTabs']['fields'];
     foreach ($fields as $key => $fieldData) {
         if ($fieldData['showOnCms']) {
             $fieldData['tab'] = 'bedard.splitter::lang.campaigns.cmsTab';
             $fieldData['cssClass'] = 'cms-field-padding';
             $form->secondaryTabs['fields']['splitter[' . $key . ']'] = $fieldData;
         }
     }
 }
 public function boot()
 {
     \Backend\Controllers\Auth::extend(function ($controller) {
         if (\Backend\Classes\BackendController::$action == 'signin') {
             if (Settings::get('google_button') == 'light') {
                 $CSS[] = 'ssologin-light.css';
             } else {
                 $CSS[] = 'ssologin.css';
             }
             if (Settings::get('hide_login_fields') == 1) {
                 $CSS[] = 'hide-login.css';
             }
             $controller->addCss(CombineAssets::combine($CSS, plugins_path() . '/martin/ssologin/assets/css/'));
         }
     });
     Event::listen('backend.auth.extendSigninView', function ($controller) {
         return View::make("martin.ssologin::login");
     });
 }
Beispiel #15
0
 public function onRender()
 {
     $css = ['assets/vendor/photoswipe/photoswipe.css', 'assets/vendor/photoswipe/default-skin/default-skin.css'];
     $js = ['assets/vendor/photoswipe/photoswipe.js', 'assets/vendor/photoswipe/photoswipe-ui-default.js', 'assets/js/performance-gallery.js'];
     $this->addCss(CombineAssets::combine($css, plugins_path() . '/abnmt/photoswipe'));
     $this->addJs(CombineAssets::combine($js, plugins_path() . '/abnmt/photoswipe'));
     $gallery = $this->property('images');
     if (!is_null($gallery)) {
         $gallery->each(function ($image) {
             $image['sizes'] = getimagesize('./' . $image->getPath());
             if ($image['sizes'][0] < $image['sizes'][1]) {
                 $image['thumb'] = $image->getThumb(177, null);
             } else {
                 $image['thumb'] = $image->getThumb(null, 177);
             }
         });
     }
     $this->gallery = $this->page['gallery'] = $gallery;
 }
Beispiel #16
0
 /**
  * Get the full path to the PageFields dir
  *
  * @return [string] Path
  */
 private function getDir()
 {
     return plugins_path('jofry/fields/fields/');
 }
 public static function getLayouts()
 {
     $layouts = [];
     foreach (Filesystem::files(Theme::getActiveTheme()->getPath() . '/partials/' . self::$componentName) as $layout) {
         if (basename($layout) == 'galleries.css') {
             continue;
         }
         if (basename($layout) == 'default.htm') {
             continue;
         }
         $name = basename(substr($layout, 0, strrpos($layout, '.')));
         if (!isset($layouts[$name])) {
             $layouts[$name] = $name;
         }
     }
     foreach (Filesystem::files(plugins_path() . '/nsrosenqvist/baguettegallery/components/baguettegallery/') as $layout) {
         if (basename($layout) == 'default.htm') {
             continue;
         }
         $name = basename(substr($layout, 0, strrpos($layout, '.')));
         if (!isset($layouts[$name])) {
             $layouts[$name] = $name;
         }
     }
     return $layouts;
 }
 /**
  * Creates full plugin path from plugin code
  *
  * @param string $code
  *
  * @returns string
  */
 protected final function createPluginPath($code)
 {
     $parts = explode('.', $code);
     $parts = array_map(function ($part) {
         return strtolower($part);
     }, $parts);
     list($vendor, $plugin) = $parts;
     return plugins_path() . '/' . $vendor . '/' . $plugin;
 }
 /**
  * Returns a 2 dimensional array of vendors and their plugins.
  */
 public function getVendorAndPluginNames()
 {
     $plugins = [];
     $dirPath = plugins_path();
     if (!File::isDirectory($dirPath)) {
         return $plugins;
     }
     $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dirPath, RecursiveDirectoryIterator::FOLLOW_SYMLINKS));
     $it->setMaxDepth(2);
     $it->rewind();
     while ($it->valid()) {
         if ($it->getDepth() > 1 && $it->isFile() && strtolower($it->getFilename()) == "plugin.php") {
             $filePath = dirname($it->getPathname());
             $pluginName = basename($filePath);
             $vendorName = basename(dirname($filePath));
             $plugins[$vendorName][$pluginName] = $filePath;
         }
         $it->next();
     }
     return $plugins;
 }
Beispiel #20
0
 /**
  * Returns the absolute component path.
  */
 public function getPath()
 {
     return plugins_path() . $this->dirName;
 }
 /**
  * get path, example: 'plugins/myplugin/theme'
  *
  * @return mixed
  */
 public static function getPath()
 {
     return trim(str_replace(base_path(), '', plugins_path(static::$path)), DIRECTORY_SEPARATOR);
 }
 /**
  * Get the plugin path from the input.
  *
  * @return string
  */
 protected function getDestinationPath()
 {
     $plugin = $this->getPluginInput();
     $parts = explode('.', $plugin);
     $name = array_pop($parts);
     $author = array_pop($parts);
     return plugins_path(strtolower($author) . '/' . strtolower($name));
 }
Beispiel #23
0
 /**
  * This command requires the git binary to be installed.
  */
 protected function utilGitPull()
 {
     foreach (File::directories(plugins_path()) as $authorDir) {
         foreach (File::directories($authorDir) as $pluginDir) {
             if (!File::isDirectory($pluginDir . '/.git')) {
                 continue;
             }
             $exec = 'cd ' . $pluginDir . ' && ';
             $exec .= 'git pull 2>&1';
             echo 'Updating plugin: ' . basename(dirname($pluginDir)) . '.' . basename($pluginDir) . PHP_EOL;
             echo shell_exec($exec);
         }
     }
     foreach (File::directories(themes_path()) as $themeDir) {
         if (!File::isDirectory($themeDir . '/.git')) {
             continue;
         }
         $exec = 'cd ' . $themeDir . ' && ';
         $exec .= 'git pull 2>&1';
         echo 'Updating theme: ' . basename($themeDir) . PHP_EOL;
         echo shell_exec($exec);
     }
 }
Beispiel #24
0
 function View()
 {
     include_once plugins_path() . '/spec/ugallery/components/gallerij/resources/UberGallery.php';
     $gallery = UberGallery::init()->createGallery($this->property('location'));
 }
Beispiel #25
0
 /**
  * Locates the plugin code based on the test file location.
  * @return string|bool
  */
 protected function guessPluginCodeFromTest()
 {
     $reflect = new ReflectionClass($this);
     $path = $reflect->getFilename();
     $basePath = plugins_path();
     $result = false;
     if (strpos($path, $basePath) === 0) {
         $result = ltrim(str_replace('\\', '/', substr($path, strlen($basePath))), '/');
         $result = implode('.', array_slice(explode('/', $result), 0, 2));
     }
     return $result;
 }
 private function runAdminer()
 {
     $this->runAdminerLoader();
     require plugins_path() . '/martin/adminer/classes/adminer-loader.php';
     return new \Martin\Adminer\Classes\EmptyResponse();
 }