/** * 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 renderListData($data, $oAllRowsData) { $data = parent::renderListData($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 { if (is_object($data)) { $this->convertDataToString($data); } $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'); $opts['position'] = $params->get('textarea_hover_location', 'top'); $data = fabrikString::truncate($data, $opts); } return $data; }
/** * Shows the data formatted for the list view * * @param string $data elements data * @param object &$thisRow all the data in the lists current row * * @return string formatted value */ public function renderListData($data, &$thisRow) { $params = $this->getParams(); $format = $params->get('text_format_string'); if ($format != '') { $str = sprintf($format, $data); $data = eval($str); } return parent::renderListData($data, $thisRow); }
/** * 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 renderListData($data, $oAllRowsData) { static $range; static $fullName; if (!isset($range)) { $range = $this->getRange(); $fullName = $this->getDataElementFullName(); } $data = $oAllRowsData->{$fullName}; $data = $this->_renderListData($data, $range); return parent::renderListData($data, $oAllRowsData); }
/** * 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 renderListData($data, $oAllRowsData) { $params = $this->getParams(); $data = $this->numberFormat($data); $format = $params->get('text_format_string'); if ($format != '') { $data = sprintf($format, $data); } if ($params->get('password') == "1") { $data = str_pad('', strlen($data), '*'); } $this->_guessLinkType($data, $oAllRowsData, 0); return parent::renderListData($data, $oAllRowsData); }
/** * Shows the data formatted for the list view * * @param string $data elements data * @param object &$thisRow all the data in the lists current row * * @return string formatted value */ public function renderListData($data, &$thisRow) { $user = JFactory::getUser(); $params = $this->getParams(); $ext = $params->get('rating-pngorgif', '.png'); $imagepath = JUri::root() . '/plugins/fabrik_element/rating/images/'; $data = FabrikWorker::JSONtoData($data, true); $url = COM_FABRIK_LIVESITE . 'index.php?option=com_fabrik&format=raw&view=plugin&task=pluginAjax&g=element&plugin=rating&method=ajax_rate&element_id=' . $this->getElement()->id; FabrikHelperHTML::addPath(COM_FABRIK_BASE . 'plugins/fabrik_element/rating/images/', 'image', 'list', false); $insrc = FabrikHelperHTML::image("star_in{$ext}", 'list', @$this->tmpl, array(), true); $outsrc = FabrikHelperHTML::image("star_out{$ext}", 'list', @$this->tmpl, array(), true); $url .= '&row_id=' . $thisRow->__pk_val; $url .= '&elementname=' . $this->getElement()->id; $url .= '&userid=' . $user->get('id'); $url .= '&nonajax=1'; $row_id = isset($thisRow->__pk_val) ? $thisRow->__pk_val : $thisRow->id; $ids = JArrayHelper::getColumn($this->getListModel()->getData(), '__pk_val'); $canRate = $this->canRate($row_id, $ids); for ($i = 0; $i < count($data); $i++) { $avg = $this->_renderListData($data[$i], $thisRow); if (!$canRate) { $atpl = ''; $a2 = ''; } else { $atpl = "<a href=\"{$url}&rating={r}\">"; $a2 = "</a>"; } $str = array(); $str[] = '<div style="width:101px">'; 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] = implode("\n", $str); } $data = json_encode($data); return parent::renderListData($data, $thisRow); }
/** * 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 renderListData($data, $oAllRowsData) { $user =& JFactory::getUser(); $params =& $this->getParams(); $ext = $params->get('rating-pngorgif', '.png'); $imagepath = JUri::root() . '/plugins/fabrik_element/rating/images/'; $data = FabrikWorker::JSONtoData($data, true); $url = COM_FABRIK_LIVESITE . 'index.php?option=com_fabrik&format=raw&view=plugin&task=pluginAjax&g=element&plugin=rating&method=ajax_rate&element_id=' . $this->getElement()->id; FabrikHelperHTML::addPath(JPATH_SITE . DS . 'plugins/fabrik_element/rating/images/', 'image', 'list', false); $insrc = FabrikHelperHTML::image("star_in{$ext}", 'list', @$this->tmpl, '', true); $outsrc = FabrikHelperHTML::image("star_out{$ext}", 'list', @$this->tmpl, '', true); $url .= '&row_id=' . $oAllRowsData->__pk_val; $url .= '&elementname=' . $this->getElement()->id; $url .= '&userid=' . $user->get('id'); $url .= '&nonajax=1'; $row_id = isset($oAllRowsData->__pk_val) ? $oAllRowsData->__pk_val : $oAllRowsData->id; $ids = JArrayHelper::getColumn($this->getListModel()->getData(), '__pk_val'); $canRate = $this->canRate($row_id, $ids); for ($i = 0; $i < count($data); $i++) { $avg = $this->_renderListData($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); $data = json_encode($data); return parent::renderListData($data, $oAllRowsData); }
/** * 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 renderListData($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->getListModel()->linkHref($this, $oAllRowsData); return $str.$this->_render($url); return parent::renderListData($data, $oAllRowsData); }
/** * 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 renderListData($data, $oAllRowsData) { $listModel = $this->getlistModel(); $params = $this->getParams(); $target = $params->get('link_target', ''); $smart_link = $params->get('link_smart_link', false); if ($listModel->getOutPutFormat() != 'rss' && ($smart_link || $target == 'mediabox')) { FabrikHelperHTML::slimbox(); } //$data = explode(GROUPSPLITTER, $data); $data = FabrikWorker::JSONtoData($data, true); for ($i=0; $i < count($data); $i++) { $data[$i] = $this->_renderListData($data[$i], $oAllRowsData); } //$data = implode(GROUPSPLITTER, $data); $data = json_encode($data); return parent::renderListData($data, $oAllRowsData); }
/** * shows the data formatted for the table view * @param string data (should be in mySQL format already) * @param string element name * @param object all the data in the tables current row * @return string formatted value */ function renderListData($data, $oAllRowsData) { //@TODO: deal with time options (currently can be defined in date_table_format param). $config = JFactory::getConfig(); $tzoffset = new DateTimeZone($config->get('offset')); $aNullDates = $this->getNullDates(); $params = $this->getParams(); $store_as_local = (int)$params->get('date_store_as_local', 0); $groupModel = $this->getGroup(); $data = FabrikWorker::JSONtoData($data, true); $f = $params->get('date_table_format', '%Y-%m-%d'); if ($f == 'Y-m-d') { $f = '%Y-%m-%d'; } $format = array(); foreach ($data as $d) { if (!in_array($d, $aNullDates)) { $date = JFactory::getDate($d); //$$$ rob - if not time selector then the date gets stored as 2009-11-13 00:00:00 //if we have a -1 timezone then date gets set to 2009-11-12 23:00:00 //then shown as 2009-11-12 which is wrong if ($params->get('date_showtime') && !$store_as_local) { $date->setTimeZone($tzoffset); } if ($f == '{age}') { $format[] = date('Y') - $date->toFormat('%Y', true); } else { $format[] = $date->toFormat($f, true); } } else { $format[] = ''; } } $data = json_encode($format); return parent::renderListData($data, $oAllRowsData); }
/** * 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 renderListData($data, $oAllRowsData) { $params = $this->getParams(); $imagepath = COM_FABRIK_LIVESITE.'/plugins/fabrik_element/thumbs/images/'; //$data = explode(GROUPSPLITTER, $data); $data = FabrikWorker::JSONtoData($data, true); $listid = $this->getlistModel()->getTable()->id; $formid = $this->getlistModel()->getTable()->form_id; $row_id = $oAllRowsData->__pk_val; $str = ''; for ($i=0; $i <count($data); $i++) { JRequest::setVar('rowid', $row_id); $myThumb = $this->_getMyThumb($listid, $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->_renderListData($data[$i], $oAllRowsData); //$count = explode(GROUPSPLITTER2, $count); $count = FabrikWorker::JSONtoData($count, true); $countUp = $count[0]; $countDown = $count[1]; $countDiff = $countUp - $countDown; $str .= "<span style='color:#32d723;' id='count_thumbup$row_id'>$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;' id='count_thumbdown$row_id'>$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); $data = json_encode($data); return parent::renderListData($data, $oAllRowsData); }
/** * 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 renderListData($data, $oAllRowsData) { $listModel = $this->getlistModel(); $params = $this->getParams(); $target = $params->get('link_target', ''); $smart_link = $params->get('link_smart_link', false); if ($listModel->getOutPutFormat() != 'rss' && ($smart_link || $target == 'mediabox')) { FabrikHelperHTML::slimbox(); } $data = FabrikWorker::JSONtoData($data, true); if (!empty($data)) { if (array_key_exists('label', $data)) { $data = (array) $this->_renderListData($data, $oAllRowsData); } else { for ($i = 0; $i < count($data); $i++) { $data[$i] = JArrayHelper::fromObject($data[$i]); $data[$i] = $this->_renderListData($data[$i], $oAllRowsData); } } } $data = json_encode($data); return parent::renderListData($data, $oAllRowsData); }
/** * shows the data formatted for the table view * @param string data (should be in mySQL format already) * @param string element name * @param object all the data in the tables current row * @return string formatted value */ function renderListData($data, $oAllRowsData) { if ($data == '') { return ''; } //@TODO: deal with time options (currently can be defined in date_table_format param). $timeZone = new DateTimeZone(JFactory::getConfig()->get('offset')); $aNullDates = $this->getNullDates(); $params = $this->getParams(); $store_as_local = (int) $params->get('date_store_as_local', 0); $groupModel = $this->getGroup(); $data = FabrikWorker::JSONtoData($data, true); $f = $params->get('date_table_format', '%Y-%m-%d'); if ($f == 'Y-m-d') { $f = '%Y-%m-%d'; } $format = array(); foreach ($data as $d) { if (!in_array($d, $aNullDates)) { $date = JFactory::getDate($d); //$$$ rob - dates always stored with time (and hence timezone offset) so, unless stored_as_local // we must set the timezone if (!$store_as_local) { $date->setTimeZone($timeZone); } if ($f == '{age}') { $format[] = date('Y') - $date->toFormat('%Y', true); } else { $format[] = $date->toFormat($f, true); } } else { $format[] = ''; } } $data = json_encode($format); return parent::renderListData($data, $oAllRowsData); }
function renderListData($data, $oAllRowsData) { $db = FabrikWorker::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() ? json_decode($data) : array($data); $data = (array) $data; $ft = $params->get('table_day_format', 'd.m.Y'); $f = $params->get('birthday_format', '%Y-%m-%d'); $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 = json_encode($format); return parent::renderListData($data, $oAllRowsData); }
/** * 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 renderListData($data, $oAllRowsData) { $data = FabrikWorker::JSONtoData($data, true); $params = $this->getParams(); $pathset = false; foreach ($data as $d) { if (strstr($d, '/')) { $pathset = true; break; } } if ($data === '' || empty($data) || !$pathset) { //no data so default to image (or simple image name stored). $iPath = $params->get('imagepath'); if (!strstr($iPath, '/')) { //single file specified so find it in tmpl folder $data = (array) FabrikHelperHTML::image($iPath, 'list', @$this->tmpl, array(), true); } else { $data = (array) $iPath; } } $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 (empty($data) || $data[0] == '') { //$data[] = $params->get('imagefile'); $data[] = $params->get('imagepath'); } 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 . $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 = json_encode($data); return parent::renderListData($data, $oAllRowsData); }
/** * 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 renderListData($data, $oAllRowsData) { $params = $this->getParams(); $data = $this->format($data); return parent::renderListData($data, $oAllRowsData); }
/** * Shows the data formatted for the list view * * @param string $data elements data * @param object &$thisRow all the data in the lists current row * * @return string formatted value */ public function renderListData($data, &$thisRow) { $data = FabrikWorker::JSONtoData($data, true); JArrayHelper::toInteger($data); $db = FabrikWorker::getDbo(true); $query = $db->getQuery(true); if (!empty($data)) { $query->select('title')->from('#__usergroups')->where('id IN (' . implode(',', $data) . ')'); $db->setQuery($query); $data = $db->loadColumn(); } $data = json_encode($data); return parent::renderListData($data, $thisRow); }
/** * 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 renderListData($data, $oAllRowsData) { $params = $this->getParams(); $data = JHTML::_('date', $data, JText::_($params->get('timestamp_format', 'DATE_FORMAT_LC2'))); return parent::renderListData($data, $oAllRowsData); }
/** * shows the data formatted for the table view * @param string data * @param object current row's data * @return string formatted value */ function renderListData($element_data, &$thisRow) { $params =& $this->getParams(); $format = trim($params->get('calc_format_string')); // $$$ hugh - the 'calculated value' bit is for legacy data that was created // before we started storing a value when row is saved if ($params->get('calc_on_save_only', 0) && $element_data != 'calculated value') { if ($format != '') { $element_data = sprintf($format, $element_data); } return parent::renderListData($element_data, $thisRow); } else { $element = $this->getElement(); $cal = $params->get('calc_calculation', ''); $listModel =& $this->getlistModel(); $formModel =& $this->getFormModel(); $data = JArrayHelper::fromObject($thisRow); $data['rowid'] = $data['__pk_val']; $data['fabrik'] = $formModel->getId(); // $$$ hugh - trying to standardize on $data so scripts know where data is, // need $d here for backward compat $d =& $data; $res = $listModel->parseMessageForRowHolder($cal, $data, true); $res = @eval($res); FabrikWorker::logEval($res, 'Caught exception on eval in ' . $element->name . '::renderListData() : %s'); if ($format != '') { $res = sprintf($format, $res); } // $$$ hugh - need to set _raw, might be needed if (say) calc is being used as 'use_as_row_class' // See comments in formatData() in table model, we might could move this to a renderRawTableData() method. $raw_name = $this->getFullName(false, true, false) . '_raw'; $thisRow->{$raw_name} = str_replace(GROUPSPLITTER, ',', $res); return parent::renderListData($res, $thisRow); } }
/** * 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 renderListData($data, $oAllRowsData) { return parent::renderListData($data, $oAllRowsData); }
/** * Shows the data formatted for the list view * * @param string $data elements data * @param object &$thisRow all the data in the lists current row * * @return string formatted value */ public function renderListData($data, &$thisRow) { $db = FabrikWorker::getDbo(); $params = $this->getParams(); $groupModel = $this->getGroup(); /* * Jaanus: removed condition canrepeat() from renderListData: * weird result such as ["00:03:45","00 when not repeating but still join and merged. Using isJoin() instead */ $data = $groupModel->isJoin() ? FabrikWorker::JSONtoData($data, true) : array($data); $data = (array) $data; $ft = $params->get('list_time_format', 'H:i:s'); $sep = $params->get('time_separatorlabel', JText::_(':')); $format = array(); foreach ($data as $d) { if ($d) { list($hour, $min, $sec) = explode(':', $d); $hms = $hour . $sep . $min . $sep . $sec; $hm = $hour . $sep . $min; $ms = $min . $sep . $sec; $timedisp = ''; if ($ft == "H:i:s") { $timedisp = $hms; } else { if ($ft == "H:i") { $timedisp = $hm; } if ($ft == "i:s") { $timedisp = $ms; } } $format[] = $timedisp; } else { $format[] = ''; } } $data = json_encode($format); return parent::renderListData($data, $thisRow); }
/** * 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 renderListData($data, $oAllRowsData) { //$data = explode(GROUPSPLITTER, $data); $data = json_decode($data, true); $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[] = $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); $data = json_encode($data); return parent::renderListData($data, $oAllRowsData); }
/** * Shows the data formatted for the list view * * @param string $data elements data * @param object &$thisRow all the data in the lists current row * * @return string formatted value */ public function renderListData($data, &$thisRow) { $params = $this->getParams(); return parent::renderListData($data, $thisRow); }
/** * 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 renderListData($data, $oAllRowsData) { $data = FabrikWorker::JSONtoData($data, true); $params = $this->getParams(); if (empty($data)) { $data[0] = $this->_renderListData('', $oAllRowsData, 0); } else { for ($i = 0; $i < count($data); $i++) { $data[$i] = $this->_renderListData($data[$i], $oAllRowsData, $i); } } $data = json_encode($data); return parent::renderListData($data, $oAllRowsData); }
/** * Shows the data formatted for the list view * * @param string $data data to show * @param object &$thisRow all the data in the tables current row * * @return string formatted value */ public function renderListData($data, &$thisRow) { $data = FabrikWorker::JSONtoData($data, true); $params = $this->getParams(); // $$$ hugh - have to run thru rendering even if data is empty, iin case default image is being used. if (empty($data)) { $data[0] = $this->_renderListData('', $thisRow, 0); } else { for ($i = 0; $i < count($data); $i++) { $data[$i] = $this->_renderListData($data[$i], $thisRow, $i); } } $data = json_encode($data); return parent::renderListData($data, $thisRow); }
/** * Shows the data formatted for the list view * * @param string $data elements data * @param object &$thisRow all the data in the lists current row * * @return string formatted value */ public function renderListData($data, &$thisRow) { unset($this->_default); $value = $this->getValue(JArrayHelper::fromObject($thisRow)); return parent::renderListData($value, $thisRow); }
/** * Shows the data formatted for the list view * * @param string $data elements data * @param object &$thisRow all the data in the lists current row * * @return string formatted value */ public function renderListData($data, &$thisRow) { return parent::renderListData($data, $thisRow); }
/** * Shows the data formatted for the list view * * @param string $data elements data * @param object &$thisRow all the data in the lists current row * * @return string formatted value */ public function renderListData($data, &$thisRow) { $db = FabrikWorker::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(); /** * Jaanus: json_decode replaced with FabrikWorker::JSONtoData that made visible also single data in repeated group * * Jaanus: removed condition canrepeat() from renderListData: weird result such as 05",null, * "1940.07.["1940 (2011) when not repeating but still join and merged. Using isJoin() instead */ $data = $groupModel->isJoin() ? FabrikWorker::JSONtoData($data, true) : array($data); $data = (array) $data; $ft = $params->get('list_date_format', 'd.m.Y'); // $ft = $params->get('birthday_format', 'd.m.Y'); //$ft = $params->get('birthday_format', '%Y-%m-%d'); $fta = $params->get('list_age_format', 'no'); $format = array(); foreach ($data as $d) { if (!in_array($d, $aNullDates)) { /** * $$$ rob default to a format date * $date = JFactory::getDate($d); * $datedisp = $date->toFormat($ft); * Jaanus: sorry, but in this manner the element doesn't work with dates earlier than 1901 */ 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'); $year = JString::ltrim($year, '0'); $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 = json_encode($format); return parent::renderListData($data, $thisRow); }
/** * Shows the data formatted for the list view * * @param string $data elements data * @param object &$thisRow all the data in the lists current row * * @return string formatted value */ public function renderListData($data, &$thisRow) { $params = $this->getParams(); $tz_offset = $params->get('gmt_or_local', '0') == '0'; $data = JHTML::_('date', $data, JText::_($params->get('timestamp_format', 'DATE_FORMAT_LC2')), $tz_offset); return parent::renderListData($data, $thisRow); }
/** * render the elements list value * @param unknown_type $data * @param unknown_type $oAllRowsData */ function renderListData($data, $oAllRowsData) { unset($this->_default); $value = $this->getValue(JArrayHelper::fromObject($oAllRowsData)); return parent::renderListData($value, $oAllRowsData); }