예제 #1
0
 /**
  * Get the src(s) for the list plugin js class
  *
  * @return  mixed  string or array
  */
 public function loadJavascriptClass_result()
 {
     $mediaFolder = FabrikHelperHTML::getMediaFolder();
     $src = parent::loadJavascriptClass_result();
     $src['element'] = $mediaFolder . '/element.js';
     return $src;
 }
예제 #2
0
 /**
  * Return the javascript to create an instance of the class defined in formJavascriptClass
  *
  * @param   array  $args  Array [0] => string table's form id to contain plugin
  *
  * @return bool
  */
 public function onLoadJavascriptInstance($args)
 {
     parent::onLoadJavascriptInstance($args);
     if (!is_object($this->getMapElement())) {
         return false;
     }
     $params = $this->getParams();
     list($latitude, $longitude) = $this->getSearchLatLon();
     $opts = $this->getElementJSOptions();
     $containerOverride = FArrayHelper::getValue($args, 0, '');
     if (strstr($containerOverride, 'visualization')) {
         $opts->ref = str_replace('visualization_', '', $containerOverride);
     }
     $opts->value = $this->getValue();
     $opts->lat = $latitude;
     $opts->lon = $longitude;
     $opts->myloc = $params->get('myloc', 1) == 1 ? true : false;
     $opts->renderOrder = $this->renderOrder;
     $opts = json_encode($opts);
     $this->jsInstance = "new FbListRadius_lookup({$opts})";
     return true;
 }
예제 #3
0
파일: email.php 프로젝트: pascal26/fabrik
 /**
  * Return the javascript to create an instance of the class defined in formJavascriptClass
  *
  * @param   array $args Array [0] => string table's form id to contain plugin
  *
  * @return bool
  */
 public function onLoadJavascriptInstance($args)
 {
     FabrikHelperHTML::slimbox();
     parent::onLoadJavascriptInstance($args);
     $opts = $this->getElementJSOptions();
     $opts->renderOrder = $this->renderOrder;
     $opts = json_encode($opts);
     $this->jsInstance = "new FbListEmail({$opts})";
     return true;
 }
예제 #4
0
 /**
  * Return the javascript to create an instance of the class defined in formJavascriptClass
  *
  * @param   array  $args  Array [0] => string table's form id to contain plugin
  *
  * @return bool
  */
 public function onLoadJavascriptInstance($args)
 {
     parent::onLoadJavascriptInstance($args);
     if (!is_object($this->getMapElement())) {
         return false;
     }
     $params = $this->getParams();
     list($latitude, $longitude) = $this->getSearchLatLon();
     $opts = $this->getElementJSOptions();
     $containerOverride = FArrayHelper::getValue($args, 0, '');
     if (strstr($containerOverride, 'visualization')) {
         $opts->ref = str_replace('visualization_', '', $containerOverride);
     }
     $opts->steps = (int) $params->get('radius_max', 100);
     $opts->unit = $params->get('radius_unit', 'km');
     $opts->value = $this->getValue();
     $opts->lat = $latitude;
     $opts->lon = $longitude;
     $preFilterDistance = $params->get('prefilter_distance', '');
     $opts->prefilter = $preFilterDistance === '' ? false : true;
     $opts->prefilterDone = (bool) $this->app->input->getBool('radius_prefilter', false);
     $opts->prefilterDistance = $preFilterDistance;
     $opts->myloc = $params->get('myloc', 1) == 1 ? true : false;
     $o = FabrikString::mapStrToCoords($params->get('geocode_default', ''));
     $opts->geocode_default_lat = $o->lat;
     $opts->geocode_default_long = $o->long;
     $opts->geocode_default_zoom = (int) $o->zoom;
     $opts->geoCodeAsType = $params->get('geocode_as_type', 1);
     $opts->renderOrder = $this->renderOrder;
     $opts->offset_y = (int) $params->get('window_offset_y', '0');
     $opts = json_encode($opts);
     $this->jsInstance = "new FbListRadius_search({$opts})";
     JText::script('PLG_LIST_RADIUS_SEARCH_CLEAR_CONFIRM');
     JText::script('PLG_LIST_RADIUS_SEARCH_GEOCODE_ERROR');
     return true;
 }
예제 #5
0
 /**
  * Return the javascript to create an instance of the class defined in formJavascriptClass
  *
  * @param   array  $args  Array [0] => string table's form id to contain plugin
  *
  * @return bool
  */
 public function onLoadJavascriptInstance($args)
 {
     parent::onLoadJavascriptInstance($args);
     $opts = $this->getElementJSOptions();
     $opts->acl = $this->acl;
     $opts = json_encode($opts);
     $this->jsInstance = "new FbListCaneditrow({$opts})";
     return true;
 }
예제 #6
0
 /**
  * Prep the button if needed
  *
  * @param   array  &$args  Arguments
  *
  * @return  bool;
  */
 public function button(&$args)
 {
     parent::button($args);
     return false;
 }
예제 #7
0
 /**
  * Return the javascript to create an instance of the class defined in formJavascriptClass
  *
  * @param   array  $args  Array [0] => string table's form id to contain plugin
  *
  * @return bool
  */
 public function onLoadJavascriptInstance($args)
 {
     parent::onLoadJavascriptInstance($args);
     $opts = $this->getElementJSOptions();
     $opts->requireChecked = false;
     $opts = json_encode($opts);
     $this->jsInstance = "new FbListWebservice({$opts})";
     return true;
 }
예제 #8
0
파일: js.php 프로젝트: ppantilla/bbninja
 /**
  * Return the javascript to create an instance of the class defined in formJavascriptClass
  *
  * @param   array  $args  Array [0] => string table's form id to contain plugin
  *
  * @return bool
  */
 public function onLoadJavascriptInstance($args)
 {
     parent::onLoadJavascriptInstance($args);
     $params = $this->getParams();
     $opts = $this->getElementJSOptions();
     $file = $params->get('js_file', '');
     if ($file !== '' && $file !== '-1') {
         $opts->js_code = file_get_contents(JPATH_ROOT . '/plugins/fabrik_list/js/scripts/' . $file);
     } else {
         $opts->js_code = $params->get('js_code', '');
     }
     $opts->statusMsg = $params->get('msg', '');
     $opts = json_encode($opts);
     $this->jsInstance = "new FbListJs({$opts})";
     return true;
 }
예제 #9
0
 /**
  * Return the javascript to create an instance of the class defined in formJavascriptClass
  *
  * @param   array  $args  Array [0] => string table's form id to contain plugin
  *
  * @return bool
  */
 public function onLoadJavascriptInstance($args)
 {
     parent::onLoadJavascriptInstance($args);
     $params = $this->getParams();
     $opts = $this->getElementJSOptions();
     $opts->userSelect = (bool) $params->get('update_user_select', 0);
     $opts->form = $this->userSelectForm();
     $opts->renderOrder = $this->renderOrder;
     $opts = json_encode($opts);
     $this->jsInstance = "new FbListUpdate_col({$opts})";
     return true;
 }
예제 #10
0
 /**
  * Return the javascript to create an instance of the class defined in formJavascriptClass
  *
  * @param   array  $args  Array [0] => string table's form id to contain plugin
  *
  * @return bool
  */
 public function onLoadJavascriptInstance($args)
 {
     parent::onLoadJavascriptInstance($args);
     $model = $this->getModel();
     $params = $this->getParams();
     list($srcs, $els, $shim) = $this->loadElementJS();
     $opts = $this->getElementJSOptions();
     $opts->elements = $els;
     $opts->formid = $model->getFormModel()->getId();
     $opts->focusClass = 'focusClass';
     $opts->editEvent = $params->get('inline_edit_event', 'dblclick');
     $opts->tabSave = $params->get('inline_tab_save', false);
     $opts->showCancel = $params->get('inline_show_cancel', true);
     $opts->showSave = (bool) $params->get('inline_show_save', true);
     $opts->loadFirst = (bool) $params->get('inline_load_first', false);
     $opts = json_encode($opts);
     $this->jsInstance = "new FbListInlineedit({$opts})";
     return true;
 }