Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 757
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 757
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 758
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 758
);
// load the css to hardcode, saving a call
$css_rules = $css_controller->get_compiled_css();
$css_rules = addslashes( $css_rules );
$translation['permalinks_structure'] = $this->
_registry->get( 'model.option' )->get( 'permalink_structure' );
$translation['calendar_url'] = preg_replace( '/^https?:/', '', $permalink );
$translation['full_calendar_url'] = preg_replace( '/^https?:/', '', $full_permalink );
// Let extensions add their scripts.
// look at Extended Views or Super Widget for examples
$extension_urls = array();
$extension_urls = apply_filters(
'ai1ec_render_js',
$extension_urls,
'ai1ec_widget.js'
);
// Removing http:// or https:// from extension URLs
foreach ( $extension_urls as &$extension_url ) {
$extension_url = preg_replace( '/https?:/', '', $extension_url );
}
$translation['extension_urls'] = $extension_urls;
// the single event page js is loaded dinamically.
$translation['event_page'] = array(
'id' => 'ai1ec_event',
'url' => preg_replace( '/^https?:/', '', AI1EC_URL ) . '/public/js/pages/event.js',
);
$translation_module = $jscontroller->create_require_js_module(
Ai1ec_Javascript_Controller::FRONTEND_CONFIG_MODULE,
$translation
);
// get requirejs
$require = file_get_contents( $require_main );
$main_widget = file_get_contents( $widget_file );
$require_config = $jscontroller->create_require_js_config_object();
$config = $jscontroller->create_require_js_module(
'ai1ec_config',
$jscontroller->get_translation_data()
);
// get jquery
$jquery = $jscontroller->get_jquery_version_based_on_browser(
isset( $_SERVER['HTTP_USER_AGENT'] )
? $_SERVER['HTTP_USER_AGENT']
: ''
);
$domready = $jscontroller->get_module(
'domReady.js'
);
$frontend = $jscontroller->get_module(
'scripts/common_scripts/frontend/common_frontend.js'
);
// compress data if possible
$compatibility_ob = $this->_registry->get( 'compatibility.ob' );
$js = <<gzip_if_possible( $js );
if (
$this->_registry->get( 'model.settings' )->get( 'cache_dynamic_js' ) &&
(
'0' === $this->_registry->get( 'model.option' )->get( 'jswidgetupdated' ) ||
! $this->_registry->get( 'filesystem.checker' )->check_file_exists(
AI1EC_PATH . self::WIDGET_JS_CACHE_FILE,
true
)
)
) {
try {
$js_path = AI1EC_ADMIN_THEME_JS_PATH . DIRECTORY_SEPARATOR;
$js_saved = file_put_contents(
$js_path . '../js_cache/ai1ec_js_widget.js',
$js
);
if ( $js_saved ) {
$this->_registry->get( 'model.option' )->set( 'jswidgetupdated', '1' );
}
} catch ( Exception $e ) {
$this->_registry->get( 'model.settings' )->set( 'cache_dynamic_js', false );
}
}
exit( 0 );
}
public function render_content( Ai1ec_Embeddable $widget_instance ) {
$args = array();
$defaults = $widget_instance->get_js_widget_configurable_defaults();
foreach ( $defaults as $id => $value ) {
if ( isset( $_GET[$id] ) ) {
$args[$id] = $_GET[$id];
}
}
$html = $widget_instance->javascript_widget( $args );
$jsonp = $this->_registry->get( 'http.response.render.strategy.jsonp' );
$jsonp->render(
array(
'data' => array( 'html' => $html )
)
);
}
}