本文整理汇总了PHP中plugins_path函数的典型用法代码示例。如果您正苦于以下问题:PHP plugins_path函数的具体用法?PHP plugins_path怎么用?PHP plugins_path使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了plugins_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onRun
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'));
}
示例2: formCreateModelObject
/**
* @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;
}
示例3: onSignup
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;
}
}
示例4: onRun
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'));
}
示例5: fire
/**
* 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));
}
示例6: getModelatorOptions
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;
}
示例7: run
/**
* 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);
}
示例8: fire
/**
* 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!');
}
示例9: run
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);
}
示例10: credentials
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']];
}
}
}
示例11: fire
/**
* 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' => '979078159189-8afk8nn2las4vk1krbv8t946qfk540up@developer.gserviceaccount.com', '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' => 'contato@estudiogenius.com.br', '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' => 'contato@estudiogenius.com.br', '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');
}
示例12: fire
/**
* 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));
}
示例13: extendFormFields
/**
* 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;
}
}
}
示例14: boot
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");
});
}
示例15: onRender
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;
}