Example #1
0
 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderTableData($data, $oAllRowsData)
 {
     $params =& $this->getParams();
     $element =& $this->getElement();
     $values = explode(GROUPSPLITTER2, $element->sub_values);
     $labels = explode(GROUPSPLITTER2, $element->sub_labels);
     //check if the data is in csv format, if so then the element is a multi drop down
     if (strstr($data, GROUPSPLITTER2)) {
         $aData = explode(GROUPSPLITTER2, $data);
         $sLabels = '';
         foreach ($aData as $tmpVal) {
             if ($params->get('icon_folder') != -1 && $params->get('icon_folder') != '') {
                 $sLabels .= $this->_replaceWithIcons($tmpVal) . "<br />";
             } else {
                 $key = array_search($tmpVal, $values);
                 $sLabels .= $labels[$key] . "<br />";
             }
         }
         return FabrikString::rtrimword($sLabels, "<br />");
     } else {
         if ($params->get('icon_folder') != -1 && $params->get('icon_folder') != '') {
             return $this->_replaceWithIcons($data) . "<br />";
         } else {
             $key = array_search($data, $values);
             return $labels[$key];
         }
     }
     return parent::renderTableData($data, $oAllRowsData);
 }
Example #2
0
 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderTableData($data, $oAllRowsData)
 {
     $data = parent::renderTableData($data, $oAllRowsData);
     $params =& $this->getParams();
     if ($params->get('textarea-tagify') == true) {
         $data = $this->tagify($data);
     }
     //$$$rob dont strip slashes here - this is done when saving to db now
     if ($params->get('use_wysiwyg', 0) == 0) {
         if (is_array($data)) {
             for ($i = 0; $i < count($data); $i++) {
                 $data[$i] = nl2br($data[$i]);
             }
         } else {
             $data = nl2br($data);
         }
     }
     if (!$params->get('textarea-tagify') && $data !== '' && (int) $params->get('textarea-truncate', 0) !== 0) {
         $opts = array();
         $opts['wordcount'] = (int) $params->get('textarea-truncate', 0);
         $opts['tip'] = $params->get('textarea-hover');
         $data = fabrikString::truncate($data, $opts);
     }
     return $data;
 }
Example #3
0
 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderTableData($data, $oAllRowsData)
 {
     $fullName = $this->_getQRElement()->getFullName();
     $data = $oAllRowsData->{$fullName};
     $data = $this->_getQRElement()->getQRValue($data, JArrayHelper::fromObject($oAllRowsData));
     $data = $this->_renderTableData($data);
     return parent::renderTableData($data, $oAllRowsData);
 }
Example #4
0
 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderTableData($data, $oAllRowsData)
 {
     $data = explode(GROUPSPLITTER, $data);
     for ($i = 0; $i < count($data); $i++) {
         $data[$i] = $this->_renderTableData($data[$i], $oAllRowsData);
     }
     $data = implode(GROUPSPLITTER, $data);
     return parent::renderTableData($data, $oAllRowsData);
 }
Example #5
0
 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderTableData($data, $oAllRowsData)
 {
     $params =& $this->getParams();
     $format = $params->get('text_format_string');
     if ($format != '') {
         $data = @eval(sprintf($format, $data));
         FabrikWorker::logEval($data, 'Caught exception on eval in ' . $this->getElement()->name . '::renderTableData() : %s');
     }
     return parent::renderTableData($data, $oAllRowsData);
 }
Example #6
0
 /**
  * write out the label for the form element
  * @param object form
  * @param bol encase label in <label> tag
  * @param string id of element related to the label
  */
 function getLabel($repeatCounter = 0)
 {
     $params =& $this->getParams();
     if ($params->get('display_showlabel', true)) {
         return parent::getLabel($repeatCounter);
     }
     $bLabel = false;
     $element =& $this->getElement();
     $element->label = $this->getValue(array());
     $elementHTMLId = $this->getHTMLId();
     if ($element->hidden) {
         return '';
     }
     $task = JRequest::getVar('task', '', 'default');
     $view = JRequest::getVar('view', '', 'form');
     if ($view == 'form' && !($this->canUse() || $this->canView())) {
         return '';
     }
     $params =& $this->getParams();
     $elementid = "fb_el_" . $elementHTMLId;
     $this->_form->loadValidationRuleClasses();
     $str = '';
     $rollOver = JText::_($params->get('hover_text_title')) . "::" . JText::_($params->get('rollover'));
     $rollOver = htmlspecialchars($rollOver, ENT_QUOTES);
     if ($this->canView()) {
         $str .= "<div class=\"fabrikLabel fabrikPluginElementDisplayLabel";
         $validations =& $this->getValidations();
         if ($this->_editable) {
             foreach ($validations as $validation) {
                 $vid = $validation->_pluginName;
                 if (array_key_exists($vid, $this->_form->_validationRuleClasses)) {
                     if ($this->_form->_validationRuleClasses[$vid] != '') {
                         $str .= " " . $this->_form->_validationRuleClasses[$vid];
                     }
                 }
             }
         }
         if ($rollOver != '::') {
             $str .= " fabrikHover";
         }
         $str .= "\" id=\"{$elementid}" . "_text\">";
         if ($bLabel) {
             $str .= "<label for=\"{$elementHTMLId}\">";
         }
         $str .= $rollOver != '::' ? "<span class='hasTip' title='{$rollOver}'>{$element->label}</span>" : $element->label;
         if ($bLabel) {
             $str .= "</label>";
         }
         $str .= "</div>\n";
     }
     return $str;
 }
Example #7
0
 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderTableData($data, $oAllRowsData)
 {
     $lang =& JFactory::getLanguage();
     $langfile = 'com_fabrik.plg.element.fabrikweather';
     $lang->load($langfile, JPATH_ADMINISTRATOR, null, true);
     $tableModel =& $this->getTableModel();
     $params =& $this->getParams();
     $data = explode(GROUPSPLITTER, $data);
     for ($i = 0; $i < count($data); $i++) {
         $data[$i] = $this->_renderTableData($data[$i], $oAllRowsData, $i);
     }
     $data = implode(GROUPSPLITTER, $data);
     return parent::renderTableData($data, $oAllRowsData);
 }
Example #8
0
 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderTableData($data, $oAllRowsData)
 {
     $tableModel =& $this->getTableModel();
     $params =& $this->getParams();
     $target = $params->get('link_target', '');
     $smart_link = $params->get('link_smart_link', false);
     if ($tableModel->_outPutFormat != 'rss' && ($smart_link || $target == 'mediabox')) {
         FabrikHelperHTML::slimbox();
     }
     $data = explode(GROUPSPLITTER, $data);
     for ($i = 0; $i < count($data); $i++) {
         $data[$i] = $this->_renderTableData($data[$i], $oAllRowsData);
     }
     $data = implode(GROUPSPLITTER, $data);
     return parent::renderTableData($data, $oAllRowsData);
 }
Example #9
0
 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderTableData($data, $oAllRowsData)
 {
     $params =& $this->getParams();
     $meta = array();
     $config = JFactory::getConfig();
     $ex = $_SERVER['SERVER_PORT'] == 80 ? 'http://' : 'https://';
     // $$$ rob no need to get other meta data as we are linking to the details which contains full meta info on what it is
     // you are liking
     $meta['og:url'] = $ex . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
     $meta['og:site_name'] = $config->getValue('sitename');
     $meta['fb:admins'] = $params->get('fblike_opengraph_applicationid');
     $str = FabrikHelperHTML::facebookGraphAPI($params->get('opengraph_applicationid'), $params->get('fblike_locale', 'en_US'), $meta);
     //in table view we like the detailed record not the table view itself
     $url = $this->getTableModel()->linkHref($this, $oAllRowsData);
     return $str . $this->_render($url);
     return parent::renderTableData($data, $oAllRowsData);
 }
Example #10
0
 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderTableData($data, $oAllRowsData)
 {
     $user =& JFactory::getUser();
     $params =& $this->getParams();
     $ext = $params->get('rating-pngorgif', '.png');
     $imagepath = COM_FABRIK_LIVESITE . 'components/com_fabrik/plugins/element/fabrikrating/images/';
     $data = explode(GROUPSPLITTER, $data);
     $url = COM_FABRIK_LIVESITE . 'index.php?option=com_fabrik&amp;format=raw&amp;controller=plugin&amp;task=pluginAjax&amp;g=element&amp;plugin=fabrikrating&amp;method=ajax_rate&amp;element_id=' . $this->getElement()->id;
     $url .= '&amp;row_id=' . $oAllRowsData->__pk_val;
     $url .= '&amp;elementname=' . $this->getElement()->id;
     $url .= '&amp;userid=' . $user->get('id');
     $url .= '&amp;nonajax=1';
     $row_id = isset($oAllRowsData->__pk_val) ? $oAllRowsData->__pk_val : $oAllRowsData->id;
     $ids = JArrayHelper::getColumn($this->getTableModel()->getData(), '__pk_val');
     $canRate = $this->canRate($row_id, $ids);
     for ($i = 0; $i < count($data); $i++) {
         $avg = $this->_renderTableData($data[$i], $oAllRowsData);
         if (!$canRate) {
             $atpl = '';
             $a2 = '';
         } else {
             $atpl = "<a href=\"{$url}&rating={r}\">";
             $a2 = "</a>";
         }
         $str = '<div style="width:100px">';
         for ($s = 0; $s < $avg; $s++) {
             $r = $s + 1;
             $a = str_replace('{r}', $r, $atpl);
             $str .= "{$a}<img src=\"{$imagepath}" . "star_in{$ext}\" style=\"padding-left:1px;\" alt=\"{$r}\" class=\"starRating rate_{$r}\"/>{$a2}";
         }
         for ($s = $avg; $s < 5; $s++) {
             $r = $s + 1;
             $a = str_replace('{r}', $r, $atpl);
             $str .= "{$a}<img src=\"{$imagepath}" . "star_out{$ext}\" style=\"padding-left:1px;\" alt=\"{$r}\" class=\"starRating rate_{$r}\"/>{$a2}";
         }
         if ($params->get('rating-mode') != 'creator-rating') {
             $str .= "<div class=\"ratingMessage\">{$avg}</div>";
         }
         $str .= '</div>';
         $data[$i] = $str;
     }
     $data = implode(GROUPSPLITTER, $data);
     return parent::renderTableData($data, $oAllRowsData);
 }
Example #11
0
 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderTableData($data, $oAllRowsData)
 {
     $params =& $this->getParams();
     $imagepath = COM_FABRIK_LIVESITE . 'components/com_fabrik/plugins/element/fabrikthumbs/images/';
     $data = explode(GROUPSPLITTER, $data);
     $tableid = $this->getTableModel()->getTable()->id;
     $formid = $this->getTableModel()->getTable()->form_id;
     $row_id = $oAllRowsData->__pk_val;
     $str = '';
     for ($i = 0; $i < count($data); $i++) {
         JRequest::setVar('rowid', $row_id);
         $myThumb = $this->_getMyThumb($tableid, $formid, $row_id);
         $imagefileup = 'thumb_up_out.gif';
         $imagefiledown = 'thumb_down_out.gif';
         if ($myThumb == 'up') {
             $imagefileup = 'thumb_up_in.gif';
             $imagefiledown = 'thumb_down_out.gif';
         } else {
             if ($myThumb == 'down') {
                 $imagefileup = 'thumb_up_out.gif';
                 $imagefiledown = 'thumb_down_in.gif';
             }
         }
         $count = $this->_renderTableData($data[$i], $oAllRowsData);
         $count = explode(GROUPSPLITTER2, $count);
         $countUp = $count[0];
         $countDown = $count[1];
         $countDiff = $countUp - $countDown;
         $str .= "<span style=\"color:#32d723;\" class=\"counter_up\">{$countUp}</span><img src=\"{$imagepath}" . "{$imagefileup}\" style=\"padding:0px 5px 0 1px;\" alt=\"UP\" class=\"thumbup\" id=\"thumbup{$row_id}\"/>";
         $str .= "<span style=\"color:#f82516;\" class=\"counter_down\">{$countDown}</span><img src=\"{$imagepath}" . "{$imagefiledown}\" style=\"padding:0px 5px 0 1px;\" alt=\"DOWN\" class=\"thumbdown\" id=\"thumbdown{$row_id}\"/>";
         //$str .= "</div>";
         $data[$i] = $str;
     }
     $data = implode(GROUPSPLITTER, $data);
     return parent::renderTableData($data, $oAllRowsData);
 }
Example #12
0
 /**
  * this builds an array containing the filters value and condition
  * @param string initial $value
  * @param string intial $condition
  * @param string eval - how the value should be handled
  * @return array (value condition)
  */
 function getFilterValue($value, $condition, $eval)
 {
     $value = $this->prepareFilterVal($value);
     $return = parent::getFilterValue($value, $condition, $eval);
     return $return;
 }
Example #13
0
 /**
  * formats the posted data for insertion into the database
  * @param mixed thie elements posted form data
  * @param array posted form data
  */
 function storeDatabaseFormat($val, $data)
 {
     $val = parent::storeDatabaseFormat($val, $data);
     return $val;
 }
Example #14
0
 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderTableData($data, $oAllRowsData)
 {
     $params =& $this->getParams();
     $data = $this->format($data);
     return parent::renderTableData($data, $oAllRowsData);
 }
Example #15
0
 /**
  * this builds an array containing the filters value and condition
  * If no date time option, then we change the filter into a ranged filter to search
  * the whole day for records.
  * @param string initial $value
  * @param string intial $condition
  * @param string eval - how the value should be handled
  * @return array (value condition) values should be in mySQL format
  */
 function getFilterValue($value, $condition, $eval)
 {
     $params =& $this->getParams();
     $store_as_local = (int) $params->get('date_store_as_local', 0);
     if (!$params->get('date_showtime', 0) || $store_as_local) {
         $this->_resetToGMT = false;
     }
     $exactTime = $this->formatContainsTime($params->get('date_table_format'));
     $filterType =& $this->getElement()->filter_type;
     switch ($filterType) {
         case 'field':
         case 'dropdown':
             $mysql = $this->tableDateToMySQL($value);
             if ($mysql !== false) {
                 $value = $mysql;
             }
             if (!$params->get('date_showtime', 0) || $exactTime == false) {
                 //$$$ rob turn into a ranged filter to search the entire day
                 $value = (array) $value;
                 $condition = 'BETWEEN';
                 $value[1] = date("Y-m-d H:i:s", strtotime($this->addDays($value[0], 1)) - 1);
             }
             break;
         case 'ranged':
             $value = (array) $value;
             foreach ($value as &$v) {
                 $mysql = $this->tableDateToMySQL($v);
                 if ($mysql !== false) {
                     $v = $mysql;
                 }
             }
             break;
     }
     $this->_resetToGMT = true;
     return parent::getFilterValue($value, $condition, $eval);
 }
Example #16
0
 /**
  * get the value
  *
  * @param array $data
  * @param int $repeatCounter
  * @param array options
  * @return unknown
  */
 function getValue($data, $repeatCounter = 0, $opts = array())
 {
     //cludge for 2 scenarios
     if (array_key_exists('rowid', $data)) {
         //when validating the data on form submission
         $key = 'rowid';
     } else {
         //when rendering the element to the form
         $key = '__pk_val';
     }
     if (empty($data) || !array_key_exists($key, $data) || array_key_exists($key, $data) && empty($data[$key])) {
         // $$$rob - if no search form data submitted for the search element then the default
         // selection was being applied instead
         if (array_key_exists('use_default', $opts) && $opts['use_default'] == false) {
             $value = '';
         } else {
             $value = $this->getDefaultValue($data);
         }
         return $value;
     }
     $res = parent::getValue($data, $repeatCounter, $opts);
     return $res;
 }
Example #17
0
 /**
  * load the javascript class that manages interaction with the form element
  * should only be called once
  * @return string javascript class file
  */
 function formJavascriptClass()
 {
     FabrikModelElement::formJavascriptClass('javascript.js', 'components/com_fabrik/plugins/element/fabrikdatabasejoin/', true);
     FabrikModelElement::formJavascriptClass('javascript.js', 'components/com_fabrik/plugins/element/fabrikuser/', true);
 }
Example #18
0
 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderTableData($data, $oAllRowsData)
 {
     static $range;
     static $fullName;
     if (!isset($range)) {
         $range = $this->getRange();
         $fullName = $this->getDataElementFullName();
     }
     $data = $oAllRowsData->{$fullName};
     $data = $this->_renderTableData($data, $range);
     return parent::renderTableData($data, $oAllRowsData);
 }
Example #19
0
 /**
  * build the query for the avg caclculation
  * @param model $tableModel
  * @param string $label the label to apply to each avg
  * @return string sql statement
  */
 protected function getMedianQuery(&$tableModel, $label = "'calc'")
 {
     $fields = $tableModel->getDBFields($this->getTableName(), 'Field');
     if ($fields[$this->getElement()->name]->Type == 'time') {
         $name = $this->getFullName(false, false, false);
         $table =& $tableModel->getTable();
         $joinSQL = $tableModel->_buildQueryJoin();
         $whereSQL = $tableModel->_buildQueryWhere();
         return "SELECT SEC_TO_TIME(TIME_TO_SEC({$name})) AS value, {$label} AS label FROM `{$table->db_table_name}` {$joinSQL} {$whereSQL}";
     } else {
         return parent::getMedianQuery($tableModel, $label);
     }
 }
Example #20
0
 function renderTableData($data, $oAllRowsData)
 {
     $db =& JFactory::getDBO();
     $aNullDates = array('0000-00-000000-00-00', '0000-00-00 00:00:00', '0000-00-00', '', $db->getNullDate());
     $params =& $this->getParams();
     $monthlabels = array(JText::_('January'), JText::_('February'), JText::_('March'), JText::_('April'), JText::_('May'), JText::_('June'), JText::_('July'), JText::_('August'), JText::_('September'), JText::_('October'), JText::_('November'), JText::_('December'));
     $monthnumbers = array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12');
     $daysys = array('01', '02', '03', '04', '05', '06', '07', '08', '09');
     $daysimple = array('1', '2', '3', '4', '5', '6', '7', '8', '9');
     $jubileum = array('0', '25', '75');
     $groupModel =& $this->getGroup();
     $data = $groupModel->canRepeat() ? explode(GROUPSPLITTER, $data) : array($data);
     $ft = $params->get('table_day_format', 'd.m.Y');
     $fta = $params->get('table_age_format', 'no');
     $format = array();
     foreach ($data as $d) {
         if (!in_array($d, $aNullDates)) {
             //$date 	= JFactory::getDate($d);
             list($year, $month, $day) = explode('-', $d);
             $daydisp = str_replace($daysys, $daysimple, $day);
             $monthdisp = str_replace($monthnumbers, $monthlabels, $month);
             $nextyear = date('Y') + 1;
             $lastyear = date('Y') - 1;
             $thisyear = date('Y');
             $dmy = $day . '.' . $month . '.' . $year;
             $mdy = $month . '/' . $day . '/' . $year;
             $dmonthyear = $daydisp . '. ' . $monthdisp . ' ' . $year;
             $monthdyear = $monthdisp . ' ' . $daydisp . ', ' . $year;
             if ($ft == "d.m.Y") {
                 $datedisp = $dmy;
             } else {
                 if ($ft == "m.d.Y") {
                     $datedisp = $mdy;
                 }
                 if ($ft == "D. month YYYY") {
                     $datedisp = $dmonthyear;
                 }
                 if ($ft == "Month d, YYYY") {
                     $datedisp = $monthdyear;
                 }
             }
             if ($fta == 'no') {
                 $format[] = $datedisp;
             } else {
                 if (date('m-d') == $month . '-' . $day) {
                     if ($fta == '{age}') {
                         $format[] = "<font color = '#DD0000'><b>" . ($thisyear - $year) . "</b></font>";
                     } else {
                         if ($fta == '{age} date') {
                             $format[] = "<font color = '#DD0000'><b>" . $datedisp . " (" . ($thisyear - $year) . ")</b></font>";
                         }
                         if ($fta == '{age} this') {
                             $format[] = "<font color = '#DD0000'><b>" . ($thisyear - $year) . " (" . $datedisp . ")</b></font>";
                         }
                         if ($fta == '{age} next') {
                             $format[] = "<font color = '#DD0000'><b>" . ($nextyear - $year) . " (" . $datedisp . ")</b></font>";
                         }
                     }
                 } else {
                     if ($fta == '{age} date') {
                         if (date('m-d') > $month . '-' . $day) {
                             $format[] = $datedisp . ' (' . ($thisyear - $year) . ')';
                         } else {
                             $format[] = $datedisp . ' (' . ($lastyear - $year) . ')';
                         }
                     } else {
                         if ($fta == '{age}') {
                             if (date('m-d') > $month . '-' . $day) {
                                 $format[] = $thisyear - $year;
                             } else {
                                 $format[] = $lastyear - $year;
                             }
                         } else {
                             if ($fta == '{age} this') {
                                 if (in_array(substr($thisyear - $year, -1), $jubileum) || in_array(substr($thisyear - $year, -2), $jubileum)) {
                                     $format[] = '<b>' . ($thisyear - $year) . ' (' . $datedisp . ')</b>';
                                 } else {
                                     $format[] = $thisyear - $year . ' (' . $datedisp . ')';
                                 }
                             }
                             if ($fta == '{age} next') {
                                 if (in_array(substr($nextyear - $year, -1), $jubileum) || in_array(substr($nextyear - $year, -2), $jubileum)) {
                                     $format[] = '<b>' . ($nextyear - $year) . ' (' . $datedisp . ')</b>';
                                 } else {
                                     $format[] = $nextyear - $year . ' (' . $datedisp . ')';
                                 }
                             }
                         }
                     }
                 }
             }
         } else {
             $format[] = '';
         }
     }
     $data = implode(GROUPSPLITTER, $format);
     return parent::renderTableData($data, $oAllRowsData);
 }
Example #21
0
 function mustValidate()
 {
     $params =& $this->getParams();
     if (!$this->canUse() && !$this->canView()) {
         return false;
     }
     return parent::mustValidate();
 }
Example #22
0
 /**
  * @since 2.1.1
  * used in form model setJoinData.
  * @return array of element names to search data in to create join data array
  * in this case append with the repeatnums data for checkboxes rendered in repeat groups
  */
 public function getJoinDataNames()
 {
     $a = parent::getJoinDataNames();
     if ($this->isJoin()) {
         $element =& $this->getElement();
         $group =& $this->getGroup()->getGroup();
         $join =& $this->getJoinModel()->getJoin();
         $repeatName = $join->table_join . '___repeatnum';
         $fvRepeatName = 'join[' . $group->join_id . '][' . $repeatName . ']';
         $a[] = array($repeatName, $fvRepeatName);
     }
     return $a;
 }
Example #23
0
 /**
  * shows the data formatted for the table view
  * @param string data
  * @param object all the data in the tables current row
  * @return string formatted value
  */
 function renderTableData($data, $oAllRowsData)
 {
     $data = explode(GROUPSPLITTER, $data);
     $params =& $this->getParams();
     $selectImage_root_folder = $params->get('selectImage_root_folder', '');
     // $$$ hugh - tidy up a bit so we don't have so many ///'s in the URL's
     $selectImage_root_folder = ltrim($selectImage_root_folder, '/');
     $selectImage_root_folder = rtrim($selectImage_root_folder, '/');
     $showImage = $params->get('show_image_in_table', 0);
     $linkURL = $params->get('link_url', '');
     if ($data[0] == '') {
         $data[0] = $params->get('imagefile');
     }
     for ($i = 0; $i < count($data); $i++) {
         if ($showImage) {
             // $$$ rob 30/06/2011 - say if we import via csv a url to the image check that and use that rather than the relative path
             $src = substr($data[$i], 0, 4) == 'http' ? $data[$i] : COM_FABRIK_LIVESITE . 'images/stories/' . $selectImage_root_folder . '/' . $data[$i];
             $data[$i] = "<img src=\"{$src}\" alt=\"{$data[$i]}\" />";
         }
         if ($linkURL) {
             $data[$i] = "<a href=\"{$linkURL}\" target=\"_blank\">" . $data[$i] . "</a>";
         }
     }
     $data = implode(GROUPSPLITTER, $data);
     return parent::renderTableData($data, $oAllRowsData);
 }
Example #24
0
 /**
  * Constructor
  */
 function __construct()
 {
     parent::__construct();
     $this->_is_upload = true;
 }
Example #25
0
 /**
  * used in notempty validation rule
  */
 function dataConsideredEmpty($data, $repeatCounter)
 {
     if ((int) JRequest::getVar('rowid', 0) !== 0) {
         if (JRequest::getVar('task') == '') {
             return parent::dataConsideredEmpty($data, $repeatCounter);
         }
         $olddaata = $this->getFormModel()->_origData[$repeatCounter];
         $name = $this->getFullName(false, true, false);
         return JArrayHelper::getValue(JArrayHelper::fromObject($olddaata), $name) === '' ? true : false;
     }
     $groupModel = $this->getGroup();
     if ($groupModel->isJoin()) {
         $name = $this->getFullName(false, true, false);
         $joinid = $groupModel->getGroup()->join_id;
         $joindata = JRequest::getVar('join', '', 'files', 'array', array());
         if (!array_key_exists('name', $joindata)) {
             return true;
         }
         $file = (array) $joindata['name'][$joinid][$name];
         return JArrayHelper::getValue($file, $repeatCounter, '') == '' ? true : false;
     } else {
         if ($this->isJoin()) {
             $join = $this->getJoinModel()->getJoin();
             $joinid = $join->id;
             $joindata = JRequest::getVar('join', '', 'post', 'array', array());
             $joindata = JArrayHelper::getValue($joindata, $joinid, array());
             $name = $this->getFullName(false, true, false);
             $joindata = JArrayHelper::getValue($joindata, $name, array());
             $joinids = JArrayHelper::getValue($joindata, 'id', array());
             return empty($joinids) ? true : false;
         } else {
             $name = $this->getFullName(true, true, false);
             $file = JRequest::getVar($name, '', 'files', 'array', array());
             if ($groupModel->canRepeat()) {
                 return JArrayHelper::getValue($file['name'], $repeatCounter, '') == '' ? true : false;
             }
         }
     }
     if (!array_key_exists('name', $file)) {
         $file = JRequest::getVar($name);
         return $file == '' ? true : false;
         //ajax test - nothing in files
     }
     // no files selected?
     return $file['name'] == '' ? true : false;
 }
Example #26
0
 /**
  * Constructor
  */
 function __construct()
 {
     parent::__construct();
 }
Example #27
0
 function renderTableData($data, $oAllRowsData)
 {
     $db =& JFactory::getDBO();
     $params =& $this->getParams();
     $groupModel =& $this->getGroup();
     $data = $groupModel->canRepeat() ? explode(GROUPSPLITTER, $data) : array($data);
     $display_format = $params->get('duration_display_format', 'short');
     $format = array();
     foreach ($data as $d) {
         $format[] = $this->_displayFormat($d);
     }
     $data = implode(GROUPSPLITTER, $format);
     return parent::renderTableData($data, $oAllRowsData);
 }