/css/checkin.css" /> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?> /css/form.css" /> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?> /css/jquery-ui.css" /> <?php echo CGoogleApi::init(); ?> <?php echo CHtml::script(CGoogleApi::load('jquery', '1.4') . "\n" . CGoogleApi::load('jqueryui', '1.8') . "\n"); ?> <title><?php echo CHtml::encode($this->pageTitle); ?> </title> </head> <body class="settings"> <div class="container" id="page"> <div id="dialog"> <?php echo $content; ?>
/** * * Registers the Javascript required for the Google map * @param array $afterInit -javascript code to be rendered after init call * @param string $language -preferred language setting for the results * @param string $region -top level geographic domain * @param ClientScript::CONSTANT $position -where to render the script * @since 2010-12-22 Antonio Ramirez (inspired by sfGMap Plugin of Fabriceb) * @since 2011-01-09 Antonio Ramirez * removed deprecated initialization procedures //$init_events[] = $this->getIconsJs(); * @since 2011-01-22 Antonio Ramirez * Added support for key drag and marker clusterer plugin * @since 2011-03-10 Matt Kay * Added polygon support (added to init_events) * @since 2011-03-23 Antonio Ramirez * Added circles and rectangles support */ public function registerMapScript($afterInit = array(), $language = null, $region = null, $position = CClientScript::POS_LOAD) { // TODO: include support in the future $params = 'sensor=false'; if ($language !== null) { $params .= '&language=' . $language; } if ($region !== null) { $params .= '®ion=' . $region; } CGoogleApi::init(); CGoogleApi::register('maps', '3', array('other_params' => $params)); $this->registerPlugins(); $js = ''; $init_events = array(); if (null !== $this->_appendTo) { $init_events[] = "\$('{$this->getContainer()}').appendTo('{$this->_appendTo}');" . PHP_EOL; } $init_events[] = 'var mapOptions = ' . $this->encode($this->options) . ';' . PHP_EOL; $init_events[] = $this->getJsName() . ' = new google.maps.Map(document.getElementById("' . $this->getContainerId() . '"), mapOptions);' . PHP_EOL; // add some more events $init_events[] = $this->getEventsJs(); $init_events[] = $this->getMarkersJs(); $init_events[] = $this->getDirectionsJs(); $init_events[] = $this->getPluginsJs(); $init_events[] = $this->getPolygonsJs(); $init_events[] = $this->getCirclesJs(); $init_events[] = $this->getRectanglesJs(); if (is_array($afterInit)) { foreach ($afterInit as $ainit) { $init_events[] = $ainit; } } if ($this->getGlobalVariable($this->getJsName() . '_info_window')) { $init_events[] = $this->getJsName() . '_info_window=new google.maps.InfoWindow();'; } if ($this->getGlobalVariable($this->getJsName() . '_info_box') && $this->resources->itemAt('infobox_config')) { $init_events[] = $this->getJsName() . '_info_box=new InfoBox(' . $this->resources->itemAt('infobox_config') . ');'; } // declare the Google Map Javascript object as global $this->addGlobalVariable($this->getJsName(), 'null'); $js = $this->getGlobalVariables(); Yii::app()->getClientScript()->registerScript('EGMap_' . $this->getJsName(), $js, CClientScript::POS_HEAD); $js = 'function ' . $this->_containerId . '_init(){' . PHP_EOL; if ($this->options['styles'] == 1) { $js .= 'var usRoadMapType = new google.maps.StyledMapType([' . PHP_EOL . '{' . PHP_EOL . '"featureType": "landscape.natural.landcover",' . PHP_EOL . '"elementType": "geometry",' . PHP_EOL . '"stylers": [' . PHP_EOL . '{"visibility": "off"},' . PHP_EOL . '{"color": "#ccc"}' . PHP_EOL . ']' . PHP_EOL . '},' . PHP_EOL . '{' . PHP_EOL . '"featureType": "water",' . PHP_EOL . '"elementType": "geometry",' . PHP_EOL . '"stylers": [' . PHP_EOL . '{"visibility": "on"},' . PHP_EOL . '{"saturation": "-70"},' . PHP_EOL . ']' . PHP_EOL . '},' . PHP_EOL . '{' . PHP_EOL . '"featureType": "road",' . PHP_EOL . '"elementType": "geometry",' . PHP_EOL . '"stylers": [{' . PHP_EOL . '"visibility": "off"' . PHP_EOL . '}]' . PHP_EOL . '},' . PHP_EOL . '{' . PHP_EOL . '"featureType": "water",' . PHP_EOL . '"elementType": "labels",' . PHP_EOL . '"stylers": [{' . PHP_EOL . '"visibility": "off"' . PHP_EOL . '}]' . PHP_EOL . '},' . PHP_EOL . '{' . PHP_EOL . '"featureType": "administrative.locality",' . PHP_EOL . '"elementType": "labels",' . PHP_EOL . '"stylers": [{' . PHP_EOL . '"visibility": "off"' . PHP_EOL . '}]' . PHP_EOL . '},' . PHP_EOL . '{' . PHP_EOL . '"featureType": "administrative.country",' . PHP_EOL . '"elementType": "labels",' . PHP_EOL . '"stylers": [{' . PHP_EOL . '"visibility": "off"' . PHP_EOL . '}]' . PHP_EOL . '},' . PHP_EOL . '{' . PHP_EOL . '"featureType": "administrative.country",' . PHP_EOL . '"elementType": "geometry.stroke",' . PHP_EOL . '"stylers": [' . PHP_EOL . '{"visibility": "on"},' . PHP_EOL . '{"weight": "3"},' . PHP_EOL . '{"invert_lightness": true},' . PHP_EOL . '{"lightness": 100},' . PHP_EOL . ']' . PHP_EOL . '}' . PHP_EOL . '], {name: "US Road Atlas"});' . PHP_EOL; } else { if ($this->options['styles'] == 2) { $js .= 'var usRoadMapType = new google.maps.StyledMapType([' . PHP_EOL . '{' . PHP_EOL . '"stylers": [' . PHP_EOL . '{"gamma": 0.49},' . PHP_EOL . '{"saturation": -57},' . PHP_EOL . '{"lightness": -46},' . PHP_EOL . ']' . PHP_EOL . '}' . PHP_EOL . '], {name: "US Road Atlas"});' . PHP_EOL; } } foreach ($init_events as $init_event) { if ($init_event) { $js .= $init_event . PHP_EOL; } } if ($this->options['styles']) { $js .= 'EGMap0.mapTypes.set("usroadatlas", usRoadMapType);' . PHP_EOL . 'EGMap0.setMapTypeId("usroadatlas");' . PHP_EOL; } $js .= ' } google.maps.event.addDomListener(window, "load",' . PHP_EOL . $this->_containerId . '_init);' . PHP_EOL; Yii::app()->getClientScript()->registerScript($this->_containerId . time(), $js, CClientScript::POS_END); }
/** * * Registers the Javascript required for the Google map * @param array $afterInit -javascript code to be rendered after init call * @param string $language -preferred language setting for the results * @param string $region -top level geographic domain * @param ClientScript::CONSTANT $position -where to render the script * @since 2010-12-22 Antonio Ramirez (inspired by sfGMap Plugin of Fabriceb) * @since 2011-01-09 Antonio Ramirez * removed deprecated initialization procedures //$init_events[] = $this->getIconsJs(); * @since 2011-01-22 Antonio Ramirez * Added support for key drag and marker clusterer plugin */ public function registerMapScript($afterInit = array(), $language = null, $region = null, $position = CClientScript::POS_LOAD) { // TODO: include support in the future $params = 'sensor=false'; if ($language !== null) { $params .= '&language=' . $language; } if ($region !== null) { $params .= '®ion=' . $region; } CGoogleApi::init(); CGoogleApi::register('maps', '3', array('other_params' => $params)); $this->registerPlugins(); $js = ''; $init_events = array(); if (null !== $this->_appendTo) { $init_events[] = "\$('{$this->getContainer()}').appendTo('{$this->_appendTo}');" . PHP_EOL; } $init_events[] = 'var mapOptions = ' . $this->encode($this->options) . ';' . PHP_EOL; $init_events[] = $this->getJsName() . ' = new google.maps.Map(document.getElementById("' . $this->getContainerId() . '"), mapOptions);' . PHP_EOL; // add some more events $init_events[] = $this->getEventsJs(); $init_events[] = $this->getMarkersJs(); $init_events[] = $this->getDirectionsJs(); $init_events[] = $this->getPluginsJs(); if (is_array($afterInit)) { foreach ($afterInit as $ainit) { $init_events[] = $ainit; } } $js = $this->getGlobalVariables(); Yii::app()->getClientScript()->registerScript('EGMap_' . $this->getJsName(), $js, CClientScript::POS_HEAD); $js = 'function ' . $this->_containerId . '_init(){' . PHP_EOL; foreach ($init_events as $init_event) { if ($init_event) { $js .= $init_event . PHP_EOL; } } $js .= ' }' . PHP_EOL . $this->_containerId . '_init();' . PHP_EOL; Yii::app()->getClientScript()->registerScript($this->_containerId . time(), $js, CClientScript::POS_LOAD); }
/** * * Registers the Javascript required for the Google map * @param array $afterInit -javascript code to be rendered after init call * @param string $language -preferred language setting for the results * @param string $region -top level geographic domain * @param ClientScript::CONSTANT $position -where to render the script * @since 2010-12-22 Antonio Ramirez (inspired by sfGMap Plugin of Fabriceb) * @since 2011-01-09 Antonio Ramirez * removed deprecated initialization procedures //$init_events[] = $this->getIconsJs(); * @since 2011-01-22 Antonio Ramirez * Added support for key drag and marker clusterer plugin * @since 2011-03-10 Matt Kay * Added polygon support (added to init_events) * @since 2011-03-23 Antonio Ramirez * Added circles and rectangles support */ public function registerMapScript($afterInit = array(), $language = null, $region = null, $position = CClientScript::POS_LOAD) { // TODO: include support in the future $params = 'sensor=false'; if ($language !== null) { $params .= '&language=' . $language; } if ($region !== null) { $params .= '®ion=' . $region; } CGoogleApi::init(); CGoogleApi::register('maps', '3', array('other_params' => $params)); $this->registerPlugins(); $js = ''; $init_events = array(); if (null !== $this->_appendTo) { $init_events[] = "\$('{$this->getContainer()}').appendTo('{$this->_appendTo}');" . PHP_EOL; } $init_events[] = 'var mapOptions = ' . $this->encode($this->options) . ';' . PHP_EOL; $init_events[] = $this->getJsName() . ' = new google.maps.Map(document.getElementById("' . $this->getContainerId() . '"), mapOptions);' . PHP_EOL; // add some more events $init_events[] = $this->getEventsJs(); $init_events[] = $this->getMarkersJs(); $init_events[] = $this->getDirectionsJs(); $init_events[] = $this->getPluginsJs(); $init_events[] = $this->getPolygonsJs(); $init_events[] = $this->getCirclesJs(); $init_events[] = $this->getRectanglesJs(); if (is_array($afterInit)) { foreach ($afterInit as $ainit) { $init_events[] = $ainit; } } if ($this->getGlobalVariable($this->getJsName() . '_info_window')) { $init_events[] = $this->getJsName() . '_info_window=new google.maps.InfoWindow();'; } if ($this->getGlobalVariable($this->getJsName() . '_info_box') && $this->resources->itemAt('infobox_config')) { $init_events[] = $this->getJsName() . '_info_box=new InfoBox(' . $this->resources->itemAt('infobox_config') . ');'; } // declare the Google Map Javascript object as global $this->addGlobalVariable($this->getJsName(), 'null'); $js = $this->getGlobalVariables(); Yii::app()->getClientScript()->registerScript('EGMap_' . $this->getJsName(), $js, CClientScript::POS_HEAD); $js = 'function ' . $this->_containerId . '_init(){' . PHP_EOL; foreach ($init_events as $init_event) { if ($init_event) { $js .= $init_event . PHP_EOL; } } $js .= ' } google.maps.event.addDomListener(window, "load",' . PHP_EOL . $this->_containerId . '_init);' . PHP_EOL; Yii::app()->getClientScript()->registerScript($this->_containerId . time(), $js, CClientScript::POS_END); }
<?php echo CGoogleApi::init(); //echo CHtml::script(CGoogleApi::load('jquery', '1.4.2')); echo CHtml::script(CGoogleApi::load("jqueryui", "1.8.2")); Yii::app()->clientScript->registerScriptFile(Yii::app()->request->baseUrl . '/js/jquery.dynotable.js'); ?> <script type="text/javascript"> $(document).ready(function(){ $('#t1').dynoTable(); /* * dynoTable configuration options * These are the options that are available with their default values */ $('#t1').dynoTable({ removeClass: '.row-remover', //class for the clickable row remover cloneClass: '.row-cloner', //class for the clickable row cloner addRowTemplateId: '#add-template', //id for the "add row template" addRowButtonId: '#add-row', //id for the clickable add row button, link, etc lastRowRemovable: true, //If true, ALL rows in the table can be removed, otherwise there will always be at least one row orderable: true, //If true, table rows can be rearranged dragHandleClass: ".drag-handle", //class for the click and draggable drag handle insertFadeSpeed: "slow", //Fade in speed when row is added removeFadeSpeed: "fast", //Fade in speed when row is removed hideTableOnEmpty: true, //If true, table is completely hidden when empty onRowRemove: function(){ //Do something when a row is removed }, onRowClone: function(){ //Do something when a row is cloned