Example #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;
 }
Example #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;
 }
Example #3
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)
 {
     FabrikHelperHTML::slimbox();
     parent::onLoadJavascriptInstance($args);
     $opts = $this->getElementJSOptions();
     $opts->renderOrder = $this->renderOrder;
     $opts = json_encode($opts);
     $this->jsInstance = "new FbListEmail({$opts})";
     return true;
 }
Example #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;
 }
Example #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;
 }
Example #6
0
 /**
  * Prep the button if needed
  *
  * @param   array  &$args  Arguments
  *
  * @return  bool;
  */
 public function button(&$args)
 {
     parent::button($args);
     return false;
 }
Example #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;
 }
Example #8
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();
     $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;
 }
Example #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;
 }
Example #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;
 }