예제 #1
0
    //jQuery wait plugin:
    $app['scripts']->add('jquery.wait', 'plugins/widgets/map_ex/assets/jquery.wait.min.js', array('uikit'));
    //Marked:
    $app['scripts']->add('marked', 'plugins/widgets/map_ex/assets/marked.min.js', array('uikit'));
    //Mailchimp for subscription:
    $app['scripts']->add('mailchimp', 'plugins/widgets/map_ex/assets/jquery.formchimp.min.js', array('uikit'));
    //jQuery form validator http://www.formvalidator.net/:
    $app['scripts']->add('jquery-form-validator', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.20/jquery.form-validator.min.js', array('uikit'));
    //Underscore.js
    $app['scripts']->add('underscore', 'plugins/widgets/map_ex/assets/underscore-min.js', array('uikit'));
    //Semantic version compare
    $app['scripts']->add('versioncompare', 'plugins/widgets/map_ex/assets/versioncompare.min.js', array('uikit'));
    //Marked:
    $app['scripts']->add('replacer', 'plugins/widgets/map_ex/assets/replacer.min.js', array('uikit'));
    //Generating dynamic update script:
    $plugin = new WidgetkitExMapPlugin($app);
    $app['scripts']->add('map_ex.dynamic-updater', $plugin->generateUpdaterJS($app), array(), 'string');
    //Generating dynamic MapEx script:
    $app['scripts']->add('map_ex.dynamic-custom', $plugin->generateMapExJS($app), array(), 'string');
}, 'request' => function ($event, $app) {
    $global = null;
    if (isset($app['request']) && isset($app['request']->request)) {
        $content = $app['request']->request->get('content');
        if (isset($content['data']['_widget']['data']['global'])) {
            $global = $content['data']['_widget']['data']['global'];
        }
    }
    if ($global) {
        //Global is set for valid requests like "Save" and "Save & Close"
        $plugin = new WidgetkitExPlugin($app);
        $plugin->saveGlobalSettings($global);
예제 #2
0
<?php

/*
MapEx plugin for Widgetkit 2.
Author: Ramil Valitov
E-mail: ramilvalitov@gmail.com
Web: http://www.valitov.me/
Git: https://github.com/rvalitov/widgetkit-map-ex
*/
require_once __DIR__ . '/WidgetkitExMapPlugin.php';
use WidgetkitEx\MapEx\WidgetkitExPlugin;
use WidgetkitEx\MapEx\WidgetkitExMapPlugin;
$map_id = uniqid('wk-map-ex');
$map_id2 = substr($map_id, 9);
$debug = new WidgetkitExMapPlugin($app, $map_id);
$info = $debug->getInfo();
if ($settings['debug_output']) {
    $debug->addInfoString("Plugin info:");
    $debug->addInfoString($info);
}
$global_settings = $debug->readGlobalSettings();
$markers = array();
$width = $settings['width'] == 'auto' ? 'auto' : (int) $settings['width'] . 'px';
$height = $settings['height'] == 'auto' ? '300px' : (int) $settings['height'] . 'px';
$zoom_phone_portrait = $settings['zoom'];
$zoom_phone_landscape = is_numeric($settings['zoom_phone_h']) ? $settings['zoom_phone_h'] : $zoom_phone_portrait;
$zoom_tablet = is_numeric($settings['zoom_tablet']) ? $settings['zoom_tablet'] : $zoom_phone_landscape;
$zoom_desktop = is_numeric($settings['zoom_desktop']) ? $settings['zoom_desktop'] : $zoom_tablet;
$zoom_large = is_numeric($settings['zoom_large']) ? $settings['zoom_large'] : $zoom_desktop;
// Markers
$item_id = 0;