Example #1
0
 /**
  * Hook for adding extra JavaScript
  *
  * @param Action $action Action object for the page
  *
  * @return boolean event handler return
  */
 function showScripts()
 {
     parent::showScripts();
     $jsonArray = array();
     while ($this->notice->fetch()) {
         if (!empty($this->notice->lat) && !empty($this->notice->lon)) {
             $jsonNotice = $this->noticeAsJson($this->notice);
             $jsonArray[] = $jsonNotice;
         }
     }
     $this->inlineScript('$(document).ready(function() { ' . ' var _notices = ' . json_encode($jsonArray) . '; ' . 'showMapstraction($("#map_canvas"), _notices); });');
     return true;
 }
Example #2
0
 /**
  * Add a confirm script for Consumer key/secret reset
  *
  * @return void
  */
 function showScripts()
 {
     parent::showScripts();
     $msg = _('Are you sure you want to reset your consumer key and secret?');
     $js = 'function confirmReset() { ';
     $js .= '    var agree = confirm("' . $msg . '"); ';
     $js .= '    return agree;';
     $js .= '}';
     $this->inlineScript($js);
 }