当前位置: 首页>>代码示例>>PHP>>正文


PHP FabrikWorker::JSONtoData方法代码示例

本文整理汇总了PHP中FabrikWorker::JSONtoData方法的典型用法代码示例。如果您正苦于以下问题:PHP FabrikWorker::JSONtoData方法的具体用法?PHP FabrikWorker::JSONtoData怎么用?PHP FabrikWorker::JSONtoData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FabrikWorker的用法示例。


在下文中一共展示了FabrikWorker::JSONtoData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderListData

 /**
  * Shows the data formatted for the list view
  *
  * @param   string   $data     Elements data
  * @param   stdClass &$thisRow All the data in the lists current row
  * @param   array    $opts     Rendering options
  *
  * @return  string    formatted value
  */
 public function renderListData($data, stdClass &$thisRow, $opts = array())
 {
     $data = FabrikWorker::JSONtoData($data, true);
     $layout = $this->getLayout('list');
     $displayData = new stdClass();
     $displayData->data = $data;
     return $layout->render($displayData);
 }
开发者ID:jfquestiaux,项目名称:fabrik,代码行数:17,代码来源:colourpicker.php

示例2: render

 /**
  * Render uploaded image
  *
  * @param   object &$model  Element model
  * @param   object &$params Element params
  * @param   string $file    Row data for this element
  * @param   object $thisRow All row's data
  *
  * @return  void
  */
 public function render(&$model, &$params, $file, $thisRow = null)
 {
     /*
      * $$$ hugh - added this hack to let people use elementname__title as a title element
      * for the image, to show in the lightbox popup.
      * So we have to work out if we're being called from a table or form
      */
     $formModel = $model->getFormModel();
     $title = basename($file);
     if ($params->get('fu_title_element') == '') {
         $title_name = $model->getFullName(true, false) . '__title';
     } else {
         $title_name = str_replace('.', '___', $params->get('fu_title_element'));
     }
     if ($this->inTableView) {
         if (array_key_exists($title_name, $thisRow)) {
             $title = $thisRow->{$title_name};
         }
     } else {
         if (is_object($formModel)) {
             if (is_array($formModel->data)) {
                 $title = FArrayHelper::getValue($formModel->data, $title_name, '');
             }
         }
     }
     $bits = FabrikWorker::JSONtoData($title, true);
     $title = FArrayHelper::getValue($bits, $model->_repeatGroupCounter, $title);
     $title = htmlspecialchars(strip_tags($title, ENT_NOQUOTES));
     $file = $model->getStorage()->getFileUrl($file);
     $fullSize = $file;
     if (!$this->fullImageInRecord($params)) {
         if ($params->get('fileupload_crop')) {
             $file = $model->getStorage()->_getCropped($fullSize);
         } else {
             $file = $model->getStorage()->_getThumb($file);
         }
     }
     list($width, $height) = $this->imageDimensions($params);
     $file = $model->storage->preRenderPath($file);
     $n = $this->inTableView ? '' : $model->getElement()->name;
     if ($params->get('restrict_lightbox', 1) == 0) {
         $n = '';
     }
     $layout = $model->getLayout('image');
     $displayData = new stdClass();
     $displayData->lightboxAttrs = FabrikHelperHTML::getLightboxAttributes($title, $n);
     $displayData->fullSize = $model->storage->preRenderPath($fullSize);
     $displayData->file = $file;
     $displayData->makeLink = $params->get('make_link', true) && !$this->fullImageInRecord($params);
     $displayData->title = $title;
     $displayData->isJoin = $model->isJoin();
     $displayData->width = $width;
     $displayData->showImage = $params->get('fu_show_image');
     $displayData->inListView = $this->inTableView;
     $displayData->height = $height;
     $displayData->isSlideShow = $this->inTableView && $params->get('fu_show_image_in_table', '0') == '2' || !$this->inTableView && !$formModel->isEditable() && $params->get('fu_show_image', '0') == '3';
     $this->output = $layout->render($displayData);
 }
开发者ID:LGBGit,项目名称:tierno,代码行数:68,代码来源:image.php

示例3: renderListData_feed

 /**
  * Render RSS feed format
  *
  * @param   string  $data      Elements data
  * @param   object  &$thisRow  All the data in the lists current row
  *
  * @return  string	Formatted value
  */
 public function renderListData_feed($data, &$thisRow)
 {
     $str = '';
     $data = FabrikWorker::JSONtoData($data, true);
     foreach ($data as $d) {
         $str .= $this->_georss($d);
     }
     return $str;
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:17,代码来源:googlemap.php

示例4: renderListData

 /**
  * 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);
     $str = '';
     foreach ($data as $d) {
         $str .= "<div style=\"width:15px;height:15px;background-color:rgb({$d})\"></div>";
     }
     return $str;
 }
开发者ID:juliano-hallac,项目名称:fabrik,代码行数:15,代码来源:colourpicker.php

示例5: renderListData

	/**
	 * 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) {
		$str = '';
		$data = FabrikWorker::JSONtoData($data, true);
		//$data = explode(GROUPSPLITTER, $data);
		foreach ($data as $d) {
			$str .= $this->_renderListData($d, $oAllRowsData);
		}
		return $str;
	}
开发者ID:Jobar87,项目名称:fabrik,代码行数:16,代码来源:video.php

示例6: renderListData

 /**
  * 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);
     $str = '';
     foreach ($data as $d) {
         $str .= '<div style="width:15px;height:15px;background-color:rgb(' . $d . ')"></div>';
     }
     return $str;
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:17,代码来源:colourpicker.php

示例7: display

 /**
  * Display the list
  *
  * @param   string $tpl template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     // Initialise variables.
     $model = $this->getModel();
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $formModel = $this->get('FormModel');
     $formModel->setId($this->item->form_id);
     $this->state = $this->get('State');
     $this->js = $model->getJs();
     $this->addToolbar();
     if ($this->item->id == 0) {
         $this->order_by = array(FText::_('COM_FABRIK_AVAILABLE_AFTER_SAVE'));
         $this->group_by = FText::_('COM_FABRIK_AVAILABLE_AFTER_SAVE');
     } else {
         $this->order_by = array();
         $feListModel = $formModel->getListModel();
         $orderBys = $feListModel->getOrderBys();
         foreach ($orderBys as $orderBy) {
             $this->order_by[] = $formModel->getElementList('order_by[]', $orderBy, true, false, false, 'id');
         }
         if (empty($this->order_by)) {
             $this->order_by[] = $formModel->getElementList('order_by[]', '', true, false, false, 'id');
         }
         $orderDir[] = JHTML::_('select.option', 'ASC', FText::_('COM_FABRIK_ASCENDING'));
         $orderDir[] = JHTML::_('select.option', 'DESC', FText::_('COM_FABRIK_DESCENDING'));
         $orderdirs = FabrikWorker::JSONtoData($this->item->order_dir, true);
         $this->order_dir = array();
         $attribs = 'class="inputbox" size="1" ';
         foreach ($orderdirs as $orderdir) {
             $this->order_dir[] = JHTML::_('select.genericlist', $orderDir, 'order_dir[]', $attribs, 'value', 'text', $orderdir);
         }
         if (empty($this->order_dir)) {
             $this->order_dir[] = JHTML::_('select.genericlist', $orderDir, 'order_dir[]', $attribs, 'value', 'text', '');
         }
         $this->group_by = $formModel->getElementList('group_by', $this->item->group_by, true, false, false);
     }
     FabrikAdminHelper::setViewLayout($this);
     $srcs = FabrikHelperHTML::framework();
     $srcs['Fabrik'] = FabrikHelperHTML::mediaFile('fabrik.js');
     $srcs['NameSpace'] = 'administrator/components/com_fabrik/views/namespace.js';
     $srcs['PluginManager'] = 'administrator/components/com_fabrik/views/pluginmanager.js';
     $srcs['AdminList'] = 'administrator/components/com_fabrik/views/list/tmpl/adminlist.js';
     $srcs['ListForm'] = 'administrator/components/com_fabrik/views/listform.js';
     $srcs['adminFilters'] = 'administrator/components/com_fabrik/views/list/tmpl/admin-filters.js';
     $shim = array();
     $dep = new stdClass();
     $dep->deps = array('admin/pluginmanager');
     $shim['admin/list/tmpl/adminlist'] = $dep;
     $shim['adminfields/tables'] = $dep;
     FabrikHelperHTML::iniRequireJS($shim);
     FabrikHelperHTML::script($srcs, $this->js);
     parent::display($tpl);
 }
开发者ID:glauberm,项目名称:cinevi,代码行数:61,代码来源:view.html.php

示例8: renderListData

	/**
	 * 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&amp;format=raw&amp;view=plugin&amp;task=pluginAjax&amp;g=element&amp;plugin=rating&amp;method=ajax_rate&amp;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 .= '&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->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}&amp;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);
	}
开发者ID:Jobar87,项目名称:fabrik,代码行数:59,代码来源:rating.php

示例9: renderListData

 /**
  * Shows the data formatted for the list view
  *
  * @param   string    $data      Elements data
  * @param   stdClass  &$thisRow  All the data in the lists current row
  * @param   array     $opts      Rendering options
  *
  * @return  string	formatted value
  */
 public function renderListData($data, stdClass &$thisRow, $opts = array())
 {
     $data = FabrikWorker::JSONtoData($data, true);
     $params = $this->getParams();
     foreach ($data as &$d) {
         $d = $this->format($d);
         $this->_guessLinkType($d, $thisRow);
         if ($params->get('render_as_qrcode', '0') === '1') {
             if (!empty($d)) {
                 $d = $this->qrCodeLink($thisRow);
             }
         }
     }
     return parent::renderListData($data, $thisRow, $opts);
 }
开发者ID:glauberm,项目名称:cinevi,代码行数:24,代码来源:field.php

示例10: renderListData

 /**
  * 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&amp;format=raw&amp;view=plugin&amp;task=pluginAjax&amp;g=element&amp;plugin=rating&amp;method=ajax_rate&amp;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 .= '&amp;row_id=' . $thisRow->__pk_val;
     $url .= '&amp;elementname=' . $this->getElement()->id;
     $url .= '&amp;userid=' . $user->get('id');
     $url .= '&amp;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}&amp;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);
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:56,代码来源:rating.php

示例11: renderListData

 /**
  * Shows the data formatted for the list view
  *
  * @param   string    $data      Elements data
  * @param   stdClass  &$thisRow  All the data in the lists current row
  * @param   array     $opts      Rendering options
  *
  * @return  string	formatted value
  */
 public function renderListData($data, stdClass &$thisRow, $opts = array())
 {
     $params = $this->getParams();
     $formId = $this->getFormModel()->getId();
     $listId = $this->getListModel()->getId();
     $rowId = isset($thisRow->__pk_val) ? $thisRow->__pk_val : $thisRow->id;
     if ($params->get('rating-mode') !== 'creator-rating') {
         $d = $this->getListModel()->getData();
         $ids = ArrayHelper::getColumn($d, '__pk_val');
         list($data, $total) = $this->getRatingAverage($data, $listId, $formId, $rowId, $ids);
     }
     $data = FabrikWorker::JSONtoData($data, true);
     FabrikHelperHTML::addPath(COM_FABRIK_BASE . 'plugins/fabrik_element/rating/images/', 'image', 'list', false);
     $colData = $this->getListModel()->getData();
     $ids = ArrayHelper::getColumn($colData, '__pk_val');
     $canRate = $this->canRate($rowId, $ids);
     for ($i = 0; $i < count($data); $i++) {
         $avg = $this->_renderListData($data[$i], $thisRow);
         $atpl = '';
         $a2 = '';
         $str = array();
         $str[] = '<div style="width:101px;position:relative;">';
         for ($s = 0; $s < $avg; $s++) {
             $r = $s + 1;
             $a = str_replace('{r}', $r, $atpl);
             $imgOpts = array('icon-class' => 'starRating rate_' . $r);
             $imgOpts['data-fabrik-rating'] = $r;
             $img = FabrikHelperHTML::image("star.png", 'list', @$this->tmpl, $imgOpts);
             $str[] = $a . $img . $a2;
         }
         for ($s = $avg; $s < 5; $s++) {
             $r = $s + 1;
             $a = str_replace('{r}', $r, $atpl);
             $imgOpts = array('icon-class' => 'starRating rate_' . $r);
             $imgOpts['data-fabrik-rating'] = $r;
             $img = FabrikHelperHTML::image("star-empty.png", 'list', @$this->tmpl, $imgOpts);
             $str[] = $a . $img . $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, $opts);
 }
开发者ID:jfquestiaux,项目名称:fabrik,代码行数:56,代码来源:rating.php

示例12: display

 /**
  * Display the list
  */
 public function display($tpl = null)
 {
     FabrikHelperHTML::framework();
     // Initialiase variables.
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $formModel = $this->get('FormModel');
     $formModel->setId($this->item->form_id);
     $this->state = $this->get('State');
     $this->js = $this->get('Js');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     $this->addToolbar();
     if ($this->item->id == 0) {
         $this->order_by = array(JText::_('COM_FABRIK_AVAILABLE_AFTER_SAVE'));
         $this->group_by = JText::_('COM_FABRIK_AVAILABLE_AFTER_SAVE');
     } else {
         $this->order_by = array();
         $orderbys = FabrikWorker::JSONtoData($this->item->order_by, true);
         foreach ($orderbys as $orderby) {
             $this->order_by[] = $formModel->getElementList('order_by[]', $orderby, true, false, false);
         }
         if (empty($this->order_by)) {
             $this->order_by[] = $formModel->getElementList('order_by[]', '', true, false, false);
         }
         $orderDir[] = JHTML::_('select.option', 'ASC', JText::_('COM_FABRIK_ASCENDING'));
         $orderDir[] = JHTML::_('select.option', 'DESC', JText::_('COM_FABRIK_DESCENDING'));
         $orderdirs = FabrikWorker::JSONtoData($this->item->order_dir, true);
         $this->order_dir = array();
         foreach ($orderdirs as $orderdir) {
             $this->order_dir[] = JHTML::_('select.genericlist', $orderDir, 'order_dir[]', 'class="inputbox" size="1" ', 'value', 'text', $orderdir);
         }
         if (empty($this->order_dir)) {
             $this->order_dir[] = JHTML::_('select.genericlist', $orderDir, 'order_dir[]', 'class="inputbox" size="1" ', 'value', 'text', '');
         }
         $this->group_by = $formModel->getElementList('group_by', $this->item->group_by, true, false, false);
     }
     parent::display($tpl);
 }
开发者ID:romuland,项目名称:khparts,代码行数:45,代码来源:view.html.php

示例13: renderListData

 /**
  * Shows the data formatted for the list view
  *
  * @param   string    $data      elements data
  * @param   stdClass  &$thisRow  all the data in the lists current row
  *
  * @return  string	formatted value
  */
 public function renderListData($data, stdClass &$thisRow)
 {
     $params = $this->getParams();
     $data = FabrikWorker::JSONtoData($data, true);
     $format = $params->get('text_format_string');
     foreach ($data as &$d) {
         $d = $this->numberFormat($d);
         if ($format != '') {
             $d = sprintf($format, $d);
         }
         if ($params->get('password') == "1") {
             $d = str_pad('', JString::strlen($d), '*');
         }
         $this->_guessLinkType($d, $thisRow, 0);
         if ($params->get('render_as_qrcode', '0') === '1') {
             $d = $this->qrCodeLink($d, $thisRow);
         }
     }
     return parent::renderListData($data, $thisRow);
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:28,代码来源:field.php

示例14: render

 /**
  * @param object element model
  * @param object element params
  * @param string row data for this element
  * @param object all row's data
  */
 function render(&$model, &$params, $file, $oAllRowsData = null)
 {
     // $$$ hugh - added this hack to let people use elementname__title as a title element
     // for the image, to show in the lightbox popup.
     // So we have to work out if we're being called from a table or form
     $title = basename($file);
     if ($params->get('fu_title_element') == '') {
         $title_name = $model->getFullName(true, true, false) . '__title';
     } else {
         $title_name = str_replace('.', '___', $params->get('fu_title_element'));
     }
     if (JRequest::getVar('view') == 'list') {
         $listModel =& $model->getlistModel();
         if (array_key_exists($title_name, $oAllRowsData)) {
             $title = $oAllRowsData->{$title_name};
         }
     } else {
         if (is_object($model->_form)) {
             if (is_array($model->_form->_data)) {
                 $group =& $model->getGroup();
                 if ($group->isJoin()) {
                     $join_id = $group->getGroup()->join_id;
                     if (isset($model->_form->_data['join'])) {
                         if (array_key_exists($join_id, $model->_form->_data['join'])) {
                             if (array_key_exists($title_name, $model->_form->_data['join'][$join_id])) {
                                 if (array_key_exists($model->_repeatGroupCounter, $model->_form->_data['join'][$join_id][$title_name])) {
                                     $title = $model->_form->_data['join'][$join_id][$title_name][$model->_repeatGroupCounter];
                                 }
                             }
                         }
                     }
                 } else {
                     if (array_key_exists($title_name, $model->_form->_data)) {
                         $title = $model->_form->_data[$title_name];
                     }
                 }
             }
         }
     }
     $bits = FabrikWorker::JSONtoData($title, true);
     $title = JArrayHelper::getValue($bits, $model->_repeatGroupCounter, $title);
     $title = htmlspecialchars(strip_tags($title, ENT_NOQUOTES));
     $element =& $model->getElement();
     $file = $model->storage->getFileUrl($file);
     $fullSize = $file;
     $width = $params->get('fu_main_max_width');
     $height = $params->get('fu_main_max_height');
     if (!$this->fullImageInRecord($params)) {
         if ($params->get('fileupload_crop')) {
             $width = $params->get('fileupload_crop_width');
             $height = $params->get('fileupload_crop_height');
             $file = $model->storage->_getCropped($fullSize);
         } else {
             $width = $params->get('thumb_max_width');
             $height = $params->get('thumb_max_height');
             $file = $model->storage->_getThumb($file);
         }
     }
     if ($model->isJoin()) {
         $this->output .= '<div class="fabrikGalleryImage" style="width:' . $width . 'px;height:' . $height . 'px; vertical-align: middle;text-align: center;">';
     }
     $img = "<img class=\"fabrikLightBoxImage\" src=\"{$file}\" alt=\"" . strip_tags($element->label) . "\" />";
     if ($params->get('make_link', true) && !$this->fullImageInRecord($params)) {
         $this->output .= "<a href=\"{$fullSize}\" rel=\"lightbox[]\" title=\"{$title}\">{$img}</a>";
     } else {
         $this->output .= $img;
     }
     if ($model->isJoin()) {
         $this->output .= '</div>';
     }
 }
开发者ID:juliano-hallac,项目名称:fabrik,代码行数:77,代码来源:image.php

示例15: renderListData

 /**
  * Shows the data formatted for the list view
  *
  * @param   string    $data      Elements data
  * @param   stdClass  &$thisRow  All the data in the lists current row
  * @param   array     $opts      Rendering options
  *
  * @return  string	formatted value
  */
 public function renderListData($data, stdClass &$thisRow, $opts = array())
 {
     $w = new FabrikWorker();
     $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 = $this->rootFolder();
     // $$$ hugh - tidy up a bit so we don't have so many ///'s in the URL's
     $selectImage_root_folder = JString::ltrim($selectImage_root_folder, '/');
     $selectImage_root_folder = JString::rtrim($selectImage_root_folder, '/');
     $selectImage_root_folder = $selectImage_root_folder === '' ? '' : $selectImage_root_folder . '/';
     $showImage = $params->get('show_image_in_table', 0);
     $linkURL = $params->get('link_url', '');
     if (empty($data) || $data[0] == '') {
         $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
             if (JString::substr($data[$i], 0, 4) == 'http') {
                 $src = $data[$i];
             } else {
                 $data[$i] = JString::ltrim($data[$i], '/');
                 $src = 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[$i] = $w->parseMessageForPlaceHolder($data[$i], $thisRow);
     }
     $data = json_encode($data);
     return parent::renderListData($data, $thisRow, $opts);
 }
开发者ID:LGBGit,项目名称:tierno,代码行数:60,代码来源:image.php


注:本文中的FabrikWorker::JSONtoData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。