Beispiel #1
0
 public function boot()
 {
     Event::listen('backend.form.extendFields', function ($form) {
         if ($form->model instanceof Backend\Models\BackendPreferences) {
             $form->addFields(['focus_searchfield' => ['label' => 'indikator.backend::lang.settings.search_label', 'type' => 'switch', 'span' => 'left', 'default' => 'false', 'comment' => 'indikator.backend::lang.settings.search_comment'], 'sidebar_description' => ['label' => 'indikator.backend::lang.settings.sidebar_label', 'type' => 'switch', 'span' => 'right', 'default' => 'false', 'comment' => 'indikator.backend::lang.settings.sidebar_comment'], 'rounded_avatar' => ['label' => 'indikator.backend::lang.settings.avatar_label', 'type' => 'switch', 'span' => 'left', 'default' => 'false', 'comment' => 'indikator.backend::lang.settings.avatar_comment'], 'virtual_keyboard' => ['label' => 'indikator.backend::lang.settings.keyboard_label', 'type' => 'switch', 'span' => 'right', 'default' => 'false', 'comment' => 'indikator.backend::lang.settings.keyboard_comment'], 'media_menu' => ['label' => 'indikator.backend::lang.settings.media_label', 'type' => 'switch', 'span' => 'left', 'default' => 'false', 'comment' => 'indikator.backend::lang.settings.media_comment'], 'more_themes' => ['label' => 'indikator.backend::lang.settings.themes_label', 'type' => 'switch', 'span' => 'right', 'default' => 'false', 'comment' => 'indikator.backend::lang.settings.themes_comment']]);
         }
     });
     BackendController::extend(function ($controller) {
         if (BackendAuth::check()) {
             $preferences = UserPreferences::forUser()->get('backend::backend.preferences');
             if (isset($preferences['focus_searchfield']) && $preferences['focus_searchfield']) {
                 $controller->addJs('/plugins/indikator/backend/assets/js/setting-search.js');
             }
             if (isset($preferences['rounded_avatar']) && $preferences['rounded_avatar']) {
                 $controller->addCss('/plugins/indikator/backend/assets/css/rounded-avatar.css');
             }
             if (isset($preferences['virtual_keyboard']) && $preferences['virtual_keyboard']) {
                 $controller->addCss('/plugins/indikator/backend/assets/css/ml-keyboard.css');
                 $controller->addJs('/plugins/indikator/backend/assets/js/ml-keyboard.js');
             }
             if (isset($preferences['media_menu']) && $preferences['media_menu']) {
                 if (PluginManager::instance()->exists('RainLab.Pages')) {
                     $controller->addCss('/plugins/indikator/backend/assets/css/media-menu-pages.css');
                 } else {
                     $controller->addCss('/plugins/indikator/backend/assets/css/media-menu.css');
                 }
             }
             if (isset($preferences['more_themes']) && $preferences['more_themes']) {
                 $controller->addJs('/plugins/indikator/backend/assets/js/setting-theme.js');
             }
         }
     });
     BackendMenu::registerContextSidenavPartial('October.System', 'system', '~/plugins/indikator/backend/partials/_system_sidebar.htm');
 }
Beispiel #2
0
 /**
  * Register our data source and renderer
  */
 public function register()
 {
     /**
      * Set up the data source for the feed
      */
     $this->app->bind('KoderHut\\RssFeedster\\DataSource', function ($app) {
         $config['page'] = Settings::get('post_page');
         $config['comments_anchor'] = Settings::get('comments_anchor');
         $config['controller'] = new Controller();
         return new PostsSource($config);
     });
     /**
      * Set up the adapter interface between the XML renderer and
      * the blog posts data
      */
     $this->app->bind(IAdapter::DI_NAMESPACE, function () {
         return new BlogPostXmlAdapter();
     });
     /**
      * Set up the feed renderer
      */
     $this->app->bind('KoderHut\\RssFeedster\\Renderer', function ($app) {
         $config = ['description' => Settings::get('feed_description'), 'title' => Settings::get('feed_title'), 'category' => Settings::get('feed_category'), 'copyright' => Settings::get('feed_copyright'), 'language' => Settings::get('feed_language'), 'link' => Url::action('KoderHut\\RssFeedster\\Controllers\\Rss@buildRssFeed')];
         $pluginPath = PluginManager::instance()->getPluginPath(Plugin::KODERHUT_RSSFEEDSTER_NS);
         $xmlTemplate = $pluginPath . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'feed-template.xml';
         return new XmlRenderer($config, file_get_contents($xmlTemplate), $this->app->make(IAdapter::DI_NAMESPACE));
     });
     return;
 }
Beispiel #3
0
 /**
  * Execute the console command.
  * @return void
  */
 public function fire()
 {
     $pluginManager = PluginManager::instance();
     $pluginName = $this->argument('name');
     $pluginName = $pluginManager->normalizeIdentifier($pluginName);
     if (!$pluginManager->hasPlugin($pluginName)) {
         return $this->error(sprintf('Unable to find a registered plugin called "%s"', $pluginName));
     }
     if (!$this->confirmToProceed(sprintf('This will DELETE "%s" from the filesystem and database.', $pluginName))) {
         return;
     }
     /*
      * Rollback plugin
      */
     $manager = UpdateManager::instance()->resetNotes();
     $manager->rollbackPlugin($pluginName);
     foreach ($manager->getNotes() as $note) {
         $this->output->writeln($note);
     }
     /*
      * Delete from file system
      */
     if ($pluginPath = $pluginManager->getPluginPath($pluginName)) {
         File::deleteDirectory($pluginPath);
         $this->output->writeln(sprintf('<info>Deleted: %s</info>', $pluginName));
     }
 }
 public function down()
 {
     if (PluginManager::instance()->hasPlugin('RainLab.Blog')) {
         Schema::dropIfExists('bedard_blogtags_post_tag');
         Schema::dropIfExists('bedard_blogtags_tags');
     }
 }
Beispiel #5
0
 /**
  * After the model is populated
  */
 public function afterFetch()
 {
     /*
      * Override the database columns with the plugin details
      * found in the plugin registration file.
      */
     $manager = PluginManager::instance();
     $pluginObj = $manager->findByIdentifier($this->code);
     if ($pluginObj) {
         $pluginInfo = $pluginObj->pluginDetails();
         foreach ($pluginInfo as $attribute => $info) {
             $this->{$attribute} = Lang::get($info);
         }
         if ($this->is_disabled) {
             $manager->disablePlugin($this->code, true);
         } else {
             $manager->enablePlugin($this->code, true);
         }
         $this->disabledBySystem = $pluginObj->disabled;
         if (($configDisabled = Config::get('cms.disablePlugins')) && is_array($configDisabled)) {
             $this->disabledByConfig = in_array($this->code, $configDisabled);
         }
     } else {
         $this->name = $this->code;
         $this->description = Lang::get('system::lang.plugins.unknown_plugin');
         $this->orphaned = true;
     }
 }
 /**
  * After the model is populated
  */
 public function afterFetch()
 {
     /*
      * Override the database columns with the plugin details
      * found in the plugin registration file.
      */
     $manager = PluginManager::instance();
     $pluginObj = $manager->findByIdentifier($this->code);
     if ($pluginObj) {
         $pluginInfo = $pluginObj->pluginDetails();
         foreach ($pluginInfo as $attribute => $info) {
             $this->{$attribute} = $info;
         }
         if ($this->is_disabled) {
             $manager->disablePlugin($this->code, true);
         } else {
             $manager->enablePlugin($this->code, true);
         }
         $this->disabledBySystem = $pluginObj->disabled;
         $this->disabledByConfig = in_array($this->code, Config::get('cms.disablePlugins'));
     } else {
         $this->name = $this->code;
         $this->description = 'Plugin has been removed from the file system.';
         $this->orphaned = true;
     }
 }
 public function boot()
 {
     $this->manager = PluginManager::instance();
     // Get paths we need
     $theme = Theme::getActiveTheme();
     $themePath = $theme->getPath();
     $pluginPath = dirname(__FILE__);
     $providerPath = $themePath . '/Plugin.php';
     // Load your theme's Theme.php file as a service provider
     if (File::exists($providerPath)) {
         // Use reflection to find out info about Plugin.php
         $info = new Classes\ClassInfo($providerPath);
         if (ltrim($info->extends, '\\') == "NSRosenqvist\\ThemesPlus\\Classes\\ThemesPlusBase") {
             // Activate the theme plugin
             $plugin = $this->manager->loadPlugin($info->namespace, $themePath);
             $identifier = $this->manager->getIdentifier($plugin);
             $definitionsFile = $pluginPath . '/composer/definitions.php';
             $this->manager->registerPlugin($plugin);
             $this->manager->bootPlugin($plugin);
             // See if we need to generate a new composer psr-4 definitions file
             if (Settings::get('definitions_generated_for') != $identifier || !File::exists($definitionsFile)) {
                 File::put($definitionsFile, $this->makeDefinitionFile($info->namespace, $themePath));
                 Settings::set('definitions_generated_for', $identifier);
             }
             // Add theme to autoload through our definitions file
             ComposerManager::instance()->autoload($pluginPath);
         }
     }
     // dd(\Composer\Autoload\ClassLoader::findFile('MyCompany\\MyTheme\\Classes\\Radical'));
     // dd(ComposerManager::instance());
 }
 /**
  * Load the available activities that are defined by plugins
  */
 protected function loadActivities()
 {
     /*  
      * Load module activities
      */
     foreach ($this->callbacks as $callback) {
         $callback($this);
     }
     /*  
      * Load plugin activities
      */
     $pluginManager = PluginManager::instance();
     $plugins = $pluginManager->getPlugins();
     foreach ($plugins as $plugin) {
         if (method_exists($plugin, 'registerFriendsActivities')) {
             $activities = $plugin->registerFriendsActivities();
             if (!is_array($activities)) {
                 continue;
             }
             foreach ($activities as $className => $code) {
                 $this->registerActivity($className, $code, $plugin);
             }
         }
     }
 }
 public function down()
 {
     if (PluginManager::instance()->hasPlugin('RainLab.Blog')) {
         Schema::table('rainlab_blog_posts', function ($table) {
             $table->dropColumn('view');
         });
     }
 }
Beispiel #10
0
 public function register_flynsarmy_menu_item_types()
 {
     $types = ['Flynsarmy\\Menu\\MenuItemTypes\\Page' => ['label' => 'Page', 'alias' => 'page', 'description' => 'A link to a CMS Page'], 'Flynsarmy\\Menu\\MenuItemTypes\\Partial' => ['label' => 'Partial', 'alias' => 'partial', 'description' => 'Render a CMS Partial'], 'Flynsarmy\\Menu\\MenuItemTypes\\Link' => ['label' => 'Link', 'alias' => 'link', 'description' => 'A given URL']];
     if (PluginManager::instance()->hasPlugin('RainLab.Blog')) {
         $types['Flynsarmy\\Menu\\MenuItemTypes\\BlogPost'] = ['label' => 'Blog Post', 'alias' => 'blog_post', 'description' => 'A link to a Blog Post'];
         $types['Flynsarmy\\Menu\\MenuItemTypes\\BlogCategory'] = ['label' => 'Blog Category', 'alias' => 'blog_category', 'description' => 'A link to a Blog Category'];
     }
     return $types;
 }
Beispiel #11
0
 /**
  * Returns the logged in user, if available
  */
 public function user()
 {
     if (!PluginManager::instance()->exists('RainLab.User')) {
         return null;
     }
     if (!Auth::check()) {
         return null;
     }
     return Auth::getUser();
 }
 public static function createFromPluginCode($pluginCode)
 {
     $pluginCodeObj = new PluginCode($pluginCode);
     $plugins = PluginManager::instance()->getPlugins();
     foreach ($plugins as $code => $plugin) {
         if ($code == $pluginCode) {
             return new PluginVector($plugin, $pluginCodeObj);
         }
     }
     return null;
 }
Beispiel #13
0
 /**
  * Load and return the feed_language dropdown options
  *
  * @return array
  */
 public function getFeedLanguageOptions()
 {
     $pluginPath = PluginManager::instance()->getPluginPath(Plugin::KODERHUT_RSSFEEDSTER_NS);
     $path = $pluginPath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'language_codes.yaml';
     if (!File::exists($path)) {
         return [];
     }
     $languages = YamlParser::parseFile($path);
     $languages = is_array($languages) ? array_flip($languages) : [];
     return $languages;
 }
Beispiel #14
0
 public function getDropdownOptions($fieldName = null, $keyValue = null)
 {
     $options = [];
     $manager = PluginManager::instance();
     if ($manager->exists('shahiemseymor.roles')) {
         $permissions = \ShahiemSeymor\Roles\Models\UserPermission::get();
         foreach ($permissions as $permission) {
             $options[$permission->id] = $permission->name;
         }
     }
     return $options;
 }
Beispiel #15
0
 public function getUserIdOptions($keyValue = null)
 {
     $manager = PluginManager::instance();
     if ($manager->exists('rainlab.user')) {
         $Users = array();
         foreach (UserModel::orderBy('surname')->orderBy('name')->get() as $user) {
             $Users[$user->id] = $user->surname . ', ' . $user->name;
         }
         return $Users;
     }
     return [0 => 'Rainlab User Model Not Installed'];
 }
Beispiel #16
0
 public function boot()
 {
     Event::listen('backend.form.extendFields', function ($form) {
         $editors = ['richeditor', 'codeeditor', 'Eein\\Wysiwyg\\FormWidgets\\Trumbowyg'];
         if ($form->model instanceof \ShahiemSeymor\Ckeditor\Models\Settings) {
             if (PluginManager::instance()->hasPlugin('Radiantweb.Problog')) {
                 $form->addFields(['show_radiantweb_problog_as_wysiwyg' => ['label' => 'shahiemseymor.ckeditor::lang.show.radiantweb_problog', 'type' => 'switch', 'span' => 'auto', 'default' => 'false', 'comment' => 'shahiemseymor.ckeditor::lang.plugins.comment', 'tab' => 'shahiemseymor.ckeditor::lang.plugins.tab']], 'primary');
             }
             if (PluginManager::instance()->hasPlugin('Radiantweb.Proevents')) {
                 $form->addFields(['show_radiantweb_proevents_as_wysiwyg' => ['label' => 'shahiemseymor.ckeditor::lang.show.radiantweb_proevents', 'type' => 'switch', 'span' => 'auto', 'default' => 'false', 'comment' => 'shahiemseymor.ckeditor::lang.plugins.comment', 'tab' => 'shahiemseymor.ckeditor::lang.plugins.tab']], 'primary');
             }
             if (PluginManager::instance()->hasPlugin('RainLab.Pages')) {
                 $form->addFields(['show_rainlab_pages_as_wysiwyg' => ['label' => 'shahiemseymor.ckeditor::lang.show.rainlab_static_pages', 'type' => 'switch', 'span' => 'auto', 'default' => 'false', 'comment' => 'shahiemseymor.ckeditor::lang.plugins.comment', 'tab' => 'shahiemseymor.ckeditor::lang.plugins.tab']], 'primary');
             }
             if (PluginManager::instance()->hasPlugin('RainLab.Editable')) {
                 $form->addFields(['show_rainlab_editable_as_wysiwyg' => ['label' => 'shahiemseymor.ckeditor::lang.show.rainlab_editable', 'type' => 'switch', 'span' => 'auto', 'default' => 'false', 'comment' => 'shahiemseymor.ckeditor::lang.plugins.comment', 'tab' => 'shahiemseymor.ckeditor::lang.plugins.tab']], 'primary');
             }
             if (PluginManager::instance()->hasPlugin('RainLab.Blog')) {
                 $form->addFields(['show_rainlab_blog_as_wysiwyg' => ['label' => 'shahiemseymor.ckeditor::lang.show.rainlab_blog', 'type' => 'switch', 'span' => 'auto', 'default' => 'false', 'comment' => 'shahiemseymor.ckeditor::lang.plugins.comment', 'tab' => 'shahiemseymor.ckeditor::lang.plugins.tab']], 'primary');
             }
             if (PluginManager::instance()->hasPlugin('ShahiemSeymor.Maintenance')) {
                 $form->addFields(['show_shahiem_maintenance_as_wysiwyg' => ['label' => 'shahiemseymor.ckeditor::lang.show.shahiemseymor_maintenance', 'type' => 'switch', 'span' => 'auto', 'default' => 'false', 'comment' => 'shahiemseymor.ckeditor::lang.plugins.comment', 'tab' => 'shahiemseymor.ckeditor::lang.plugins.tab']], 'primary');
             }
         }
         if (Settings::get('show_cms_pages_as_wysiwyg', false) && get_class($form->config->model) == 'Cms\\Classes\\Page') {
             return static::useEditor($form, $editors);
         }
         if (Settings::get('show_cms_content_as_wysiwyg', false) && get_class($form->config->model) == 'Cms\\Classes\\Content') {
             return static::useEditor($form, $editors);
         }
         if (Settings::get('show_cms_partial_as_wysiwyg', false) && get_class($form->config->model) == 'Cms\\Classes\\Partial') {
             return static::useEditor($form, $editors);
         }
         if (Settings::get('show_cms_layouts_as_wysiwyg', false) && get_class($form->config->model) == 'Cms\\Classes\\Layout') {
             return static::useEditor($form, $editors);
         }
         if (Settings::get('show_rainlab_blog_as_wysiwyg', false) && $form->model instanceof \RainLab\Blog\Models\Post) {
             return static::useEditor($form, $editors);
         }
         if (Settings::get('show_shahiem_maintenance_as_wysiwyg', false) && $form->model instanceof \ShahiemSeymor\Maintenance\Models\Settings) {
             return static::useEditor($form, ['richeditor', 'Eein\\Wysiwyg\\FormWidgets\\Trumbowyg']);
         }
         if (Settings::get('show_rainlab_pages_as_wysiwyg', false) && get_class($form->config->model) == 'RainLab\\Pages\\Classes\\Page') {
             return static::useEditor($form, $editors);
         }
         if (Settings::get('show_radiantweb_problog_as_wysiwyg', false) && $form->model instanceof \Radiantweb\Problog\Models\Post) {
             return static::useEditor($form, $editors);
         }
         if (Settings::get('show_radiantweb_proevents_as_wysiwyg', false) && $form->model instanceof \Radiantweb\Proevents\Models\Event) {
             return static::useEditor($form, $editors);
         }
     });
 }
 /**
  * Index action.
  * @return null
  */
 public function index()
 {
     $this->pageTitle = trans('axc.datamanagement::lang.settings.label');
     $this->addJs('/plugins/axc/datamanagement/assets/dist/home.js', 'core');
     $this->addCss('/plugins/axc/datamanagement/assets/dist/home.css', 'core');
     $navigation = \System\Classes\PluginManager::instance()->findByIdentifier('AxC.DataManagement')->registerNavigation();
     array_shift($navigation['data-management']['sideMenu']);
     $this->vars['tile_bg'] = ['', 'cyan', 'darkRed', 'green', 'orange', 'darkPink', 'amber', 'darkCobalt', 'lightGreen', 'darkCyan'];
     $this->vars['tile_size'] = ['', 'double-vertical', 'quadro', 'double', '', 'double', '', 'double', '', ''];
     $this->vars['parts'] = $navigation['data-management']['sideMenu'];
     $this->vars['index'] = 1;
 }
Beispiel #18
0
 public function run()
 {
     $manager = PluginManager::instance();
     if ($manager->exists('shahiemseymor.roles')) {
         if (!\ShahiemSeymor\Roles\Models\UserPermission::where('name', '=', 'calendar_public')->first()) {
             \ShahiemSeymor\Roles\Models\UserPermission::create(['name' => 'calendar_public']);
         }
         if (!\ShahiemSeymor\Roles\Models\UserPermission::where('name', '=', 'calendar_deny_all')->first()) {
             \ShahiemSeymor\Roles\Models\UserPermission::create(['name' => 'calendar_deny_all']);
         }
     }
 }
Beispiel #19
0
 public function Retrieve()
 {
     $serviceUrls = [];
     $manager = PluginManager::instance();
     $plugins = $manager->getPlugins();
     foreach ($plugins as $authPlug => $plugin) {
         if (method_exists($plugin, 'messageURL')) {
             $serviceUrls[$authPlug] = $plugin->messageURL();
         }
     }
     $this->doRequests($serviceUrls);
     return null;
 }
 public function down()
 {
     if (PluginManager::instance()->hasPlugin('RainLab.Blog')) {
         Schema::table('rainlab_blog_posts', function ($table) {
             $table->dropColumn('seo_title');
             $table->dropColumn('seo_description');
             $table->dropColumn('seo_keywords');
             $table->dropColumn('canonical_url');
             $table->dropColumn('redirect_url');
             $table->dropColumn('robot_index');
             $table->dropColumn('robot_follow');
         });
     }
 }
Beispiel #21
0
 /**
  * Initialize this singleton.
  */
 protected function init()
 {
     $this->pluginManager = PluginManager::instance();
     $this->versionManager = VersionManager::instance();
     $this->migrator = App::make('migrator');
     $this->repository = App::make('migration.repository');
     $this->tempDirectory = Config::get('cms.tempDir', sys_get_temp_dir());
     $this->baseDirectory = PATH_BASE;
     /*
      * Ensure temp directory exists
      */
     if (!File::isDirectory($this->tempDirectory)) {
         File::makeDirectory($this->tempDirectory, 0777, true);
     }
 }
 public function run()
 {
     if (\Schema::hasTable('julius_multidomain_settings')) {
         $rows = \DB::table('julius_multidomain_settings')->get(['domain', 'page_url', 'is_protected', 'type', 'created_at', 'updated_at']);
         $data = [];
         foreach ($rows as $row) {
             $data[] = get_object_vars($row);
         }
         \DB::table('julius_multidomain_settings')->insert($data);
         if (PluginManager::instance()->exists('julius.Multidomain')) {
             \Artisan::call('plugin:remove', ['name' => 'julius.Multidomain', '--force' => true]);
         }
         \Schema::dropIfExists('julius_multisite_settings');
     }
 }
Beispiel #23
0
 /**
  * Initialize this singleton.
  */
 protected function init()
 {
     $this->pluginManager = PluginManager::instance();
     $this->versionManager = VersionManager::instance();
     $this->tempDirectory = temp_path();
     $this->baseDirectory = base_path();
     $this->disableCoreUpdates = Config::get('cms.disableCoreUpdates', false);
     $this->bindContainerObjects();
     /*
      * Ensure temp directory exists
      */
     if (!File::isDirectory($this->tempDirectory)) {
         File::makeDirectory($this->tempDirectory, 0777, true);
     }
 }
Beispiel #24
0
 /**
  * Если установлен плагин Lovata.Articles получаем из него список новостей
  * @param null $keyValue
  * @param null $fieldName
  * @return array
  */
 public function articlesListStatuses($keyValue = null, $fieldName = null)
 {
     if (PluginManager::instance()->hasPlugin('Lovata.Articles')) {
         $arList = [];
         $obArticles = Article::orderBy('published_start')->get();
         if (empty($obArticles)) {
             return [];
         }
         foreach ($obArticles as $obArticle) {
             $arList[$obArticle->id] = $obArticle->title;
         }
         return $arList;
     }
     return [];
 }
Beispiel #25
0
 /**
  * Get all Static Pages as an option array
  *
  * @return array
  */
 public static function getStaticPageOptions()
 {
     $hasPagesPlugin = PluginManager::instance()->hasPlugin('RainLab.Pages');
     if (!$hasPagesPlugin) {
         return [];
     }
     $pages = \RainLab\Pages\Classes\Page::listInTheme(Theme::getActiveTheme());
     $options = [];
     /** @var \RainLab\Pages\Classes\Page $page */
     foreach ($pages as $page) {
         if (array_key_exists('title', $page->viewBag)) {
             $options[$page->getFileName()] = $page->viewBag['title'];
         }
     }
     return $options;
 }
 public function __construct()
 {
     parent::__construct();
     $preferences = UserPreferences::forUser()->get('backend::backend.preferences');
     if (PluginManager::instance()->hasPlugin('AnandPatel.WysiwygEditors')) {
         $this->addCss('http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css');
         $this->addCss('/plugins/anandpatel/wysiwygeditors/resources/assets/css/elfinder.min.css');
         $this->addCss('/plugins/anandpatel/wysiwygeditors/resources/assets/css/theme.css');
         $this->addJs('http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js');
         $this->addJs('/plugins/anandpatel/wysiwygeditors/resources/assets/js/elfinder.min.js');
         if ($preferences['locale'] != 'en' && File::exists('plugins/anandpatel/wysiwygeditors/resources/assets/js/i18n/elfinder.' . $preferences['locale'] . '.js')) {
             $this->addJs('/plugins/anandpatel/wysiwygeditors/resources/assets/js/i18n/elfinder.' . $preferences['locale'] . '.js');
         }
     }
     BackendMenu::setContext('Indikator.Filemanager', 'pages');
 }
Beispiel #27
0
 /**
  * Execute the console command.
  * @return void
  */
 public function fire()
 {
     $pluginName = $this->argument('name');
     $pluginName = PluginManager::instance()->normalizeIdentifier($pluginName);
     $manager = UpdateManager::instance()->resetNotes();
     $manager->rollbackPlugin($pluginName);
     foreach ($manager->getNotes() as $note) {
         $this->output->writeln($note);
     }
     $manager->resetNotes();
     $this->output->writeln('<info>Reinstalling plugin...</info>');
     $manager->updatePlugin($pluginName);
     foreach ($manager->getNotes() as $note) {
         $this->output->writeln($note);
     }
 }
Beispiel #28
0
 public function register()
 {
     \Event::listen('backend.form.extendFields', function ($widget) {
         if (PluginManager::instance()->hasPlugin('RainLab.Pages') && $widget->model instanceof \RainLab\Pages\Classes\Page) {
             $widget->addFields(['viewBag[seo_title]' => ['label' => 'Meta Title', 'type' => 'text', 'tab' => 'cms::lang.editor.meta'], 'viewBag[seo_description]' => ['label' => 'Meta Description', 'type' => 'textarea', 'size' => 'tiny', 'tab' => 'cms::lang.editor.meta'], 'viewBag[seo_keywords]' => ['label' => 'Meta Keywords', 'type' => 'textarea', 'size' => 'tiny', 'tab' => 'cms::lang.editor.meta'], 'viewBag[canonical_url]' => ['label' => 'Canonical URL', 'type' => 'text', 'tab' => 'cms::lang.editor.meta', 'span' => 'left'], 'viewBag[redirect_url]' => ['label' => 'Redirect URL', 'type' => 'text', 'tab' => 'cms::lang.editor.meta', 'span' => 'right'], 'viewBag[robot_index]' => ['label' => 'Robot Index', 'type' => 'dropdown', 'tab' => 'cms::lang.editor.meta', 'options' => $this->getIndexOptions(), 'default' => 'index', 'span' => 'left'], 'viewBag[robot_follow]' => ['label' => 'Robot Follow', 'type' => 'dropdown', 'tab' => 'cms::lang.editor.meta', 'options' => $this->getFollowOptions(), 'default' => 'follow', 'span' => 'right']], 'primary');
         }
         if (PluginManager::instance()->hasPlugin('RainLab.Blog') && $widget->model instanceof \RainLab\Blog\Models\Post) {
             $widget->addFields(['seo_title' => ['label' => 'Meta Title', 'type' => 'text', 'tab' => 'SEO'], 'seo_description' => ['label' => 'Meta Description', 'type' => 'textarea', 'size' => 'tiny', 'tab' => 'SEO'], 'seo_keywords' => ['label' => 'Meta Keywords', 'type' => 'textarea', 'size' => 'tiny', 'tab' => 'SEO'], 'canonical_url' => ['label' => 'Canonical URL', 'type' => 'text', 'tab' => 'SEO', 'span' => 'left'], 'redirect_url' => ['label' => 'Redirect URL', 'type' => 'text', 'tab' => 'SEO', 'span' => 'right'], 'robot_index' => ['label' => 'Robot Index', 'type' => 'dropdown', 'tab' => 'SEO', 'options' => $this->getIndexOptions(), 'default' => 'index', 'span' => 'left'], 'robot_follow' => ['label' => 'Robot Follow', 'type' => 'dropdown', 'tab' => 'SEO', 'options' => $this->getFollowOptions(), 'default' => 'follow', 'span' => 'right']], 'secondary');
         }
         if (!$widget->model instanceof \Cms\Classes\Page) {
             return;
         }
         if (!($theme = Theme::getEditTheme())) {
             throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found'));
         }
         $widget->addFields(['settings[seo_keywords]' => ['label' => 'Meta Keywords', 'type' => 'textarea', 'tab' => 'cms::lang.editor.meta', 'size' => 'tiny', 'placeholder' => "hello"], 'settings[canonical_url]' => ['label' => 'Canonical URL', 'type' => 'text', 'tab' => 'cms::lang.editor.meta', 'span' => 'left'], 'settings[redirect_url]' => ['label' => 'Redirect URL', 'type' => 'text', 'tab' => 'cms::lang.editor.meta', 'span' => 'right'], 'settings[robot_index]' => ['label' => 'Robot Index', 'type' => 'dropdown', 'tab' => 'cms::lang.editor.meta', 'options' => $this->getIndexOptions(), 'default' => 'index', 'span' => 'left'], 'settings[robot_follow]' => ['label' => 'Robot Follow', 'type' => 'dropdown', 'tab' => 'cms::lang.editor.meta', 'options' => $this->getFollowOptions(), 'default' => 'follow', 'span' => 'right']], 'primary');
     });
 }
Beispiel #29
0
 /**
  * Execute the console command.
  * @return void
  */
 public function fire()
 {
     $pluginName = $this->argument('name');
     $pluginName = PluginManager::instance()->normalizeIdentifier($pluginName);
     if (!PluginManager::instance()->exists($pluginName)) {
         throw new \InvalidArgumentException(sprintf('Plugin "%s" not found.', $pluginName));
     }
     $manager = UpdateManager::instance()->resetNotes();
     $manager->rollbackPlugin($pluginName);
     foreach ($manager->getNotes() as $note) {
         $this->output->writeln($note);
     }
     $manager->resetNotes();
     $this->output->writeln('<info>Reinstalling plugin...</info>');
     $manager->updatePlugin($pluginName);
     foreach ($manager->getNotes() as $note) {
         $this->output->writeln($note);
     }
 }
Beispiel #30
0
 /**
  * Execute the console command.
  * @return void
  */
 public function fire()
 {
     $pluginName = $this->argument('name');
     $manager = UpdateManager::instance()->resetNotes();
     $pluginDetails = $manager->requestPluginDetails($pluginName);
     $code = array_get($pluginDetails, 'code');
     $hash = array_get($pluginDetails, 'hash');
     $this->output->writeln(sprintf('<info>Downloading plugin: %s</info>', $code));
     $manager->downloadPlugin($code, $hash);
     $this->output->writeln(sprintf('<info>Unpacking plugin: %s</info>', $code));
     $manager->extractPlugin($code, $hash);
     /*
      * Migrate plugin
      */
     $this->output->writeln(sprintf('<info>Migrating plugin...</info>', $code));
     PluginManager::instance()->loadPlugins();
     $manager->updatePlugin($code);
     foreach ($manager->getNotes() as $note) {
         $this->output->writeln($note);
     }
 }