/** * Returns javascript which creates an instance of the class defined in formJavascriptClass() * * @param int $repeatCounter repeat group counter * * @return string */ public function elementJavascript($repeatCounter) { if (!$this->isEditable()) { return; } FabrikHelperHTML::addPath(COM_FABRIK_BASE . 'plugins/fabrik_element/colourpicker/images/', 'image', 'form', false); $params = $this->getParams(); $element = $this->getElement(); $id = $this->getHTMLId($repeatCounter); $data = $this->_form->_data; $value = $this->getValue($data, $repeatCounter); $vars = explode(",", $value); $vars = array_pad($vars, 3, 0); $opts = $this->getElementJSOptions($repeatCounter); $c = new stdClass(); // 14/06/2011 changed over to color param object from ind colour settings $c->red = (int) $vars[0]; $c->green = (int) $vars[1]; $c->blue = (int) $vars[2]; $opts->colour = $c; $swatch = $params->get('colourpicker-swatch', 'default.js'); $swatchFile = JPATH_SITE . '/plugins/fabrik_element/colourpicker/swatches/' . $swatch; $opts->swatch = json_decode(JFile::read($swatchFile)); $opts->closeImage = FabrikHelperHTML::image("close.gif", 'form', @$this->tmpl, array(), true); $opts->handleImage = FabrikHelperHTML::image("handle.gif", 'form', @$this->tmpl, array(), true); $opts->trackImage = FabrikHelperHTML::image("track.gif", 'form', @$this->tmpl, array(), true); $opts = json_encode($opts); return "new ColourPicker('{$id}', {$opts})"; }
/** * Tagify a string * * @param string $data Tagify * * @return string Tagified string */ protected function tagify($data) { $name = $this->getFullName(true, false); $params = $this->getParams(); $listModel = $this->getlistModel(); $filters = $listModel->getFilterArray(); $fkeys = JArrayHelper::getValue($filters, 'key', array()); $data = explode(",", strip_tags($data)); $tags = array(); $url = $params->get('textarea_tagifyurl'); if ($url == '') { $url = $_SERVER['REQUEST_URI']; $bits = explode('?', $url); $root = JArrayHelper::getValue($bits, 0, '', 'string'); $bits = JArrayHelper::getValue($bits, 1, '', 'string'); $bits = explode("&", $bits); $fullName = $this->getFullName(true, false); for ($b = count($bits) - 1; $b >= 0; $b--) { $parts = explode("=", $bits[$b]); if (count($parts) > 1) { $key = FabrikString::ltrimword(FabrikString::safeColNameToArrayKey($parts[0]), '&'); if ($key == $fullName) { unset($bits[$b]); } if ($key == $fullName . '[value]') { unset($bits[$b]); } if ($key == $fullName . '[condition]') { unset($bits[$b]); } } } } $url = $root . '?' . implode('&', $bits); // $$$ rob 24/02/2011 remove duplicates from tags $data = array_unique($data); $img = FabrikWorker::j3() ? 'bookmark.png' : 'tag.png'; $icon = FabrikHelperHTML::image($img, 'form', @$this->tmpl, array('alt' => 'tag')); foreach ($data as $d) { $d = trim($d); if ($d != '') { if (trim($params->get('textarea_tagifyurl')) == '') { $qs = strstr($url, '?'); if (substr($url, -1) === '?') { $thisurl = $url . $name . '[value]=' . $d; } else { $thisurl = strstr($url, '?') ? $url . '&' . $name . '[value]=' . urlencode($d) : $url . '?' . $name . '[value]=' . urlencode($d); } $thisurl .= '&' . $name . '[condition]=CONTAINS'; $thisurl .= '&resetfilters=1'; } else { $thisurl = str_replace('{tag}', urlencode($d), $url); } $tags[] = '<a href="' . $thisurl . '" class="fabrikTag">' . $icon . $d . '</a>'; } } return implode(' ', $tags); }
public function button_result() { if ($this->canUse()) { $name = $this->_getButtonName(); $label = $this->buttonLabel(); $img = FabrikHelperHTML::image($this->_buttonPrefix.'.png', 'list', '', $label); return "<a href=\"#\" class=\"$name listplugin\"/>".$img."<span>".$label.'</span></a>'; } return ''; }
/** * create the HTML for rendering a button in the top button list * @return string <a> link */ public function topButton_result() { if ($this->canUse()) { $name = $this->_getButtonName(); $label = $this->buttonLabel(); $imageName = $this->getParams()->get('list_' . $this->buttonPrefix . '_image_name', $this->buttonPrefix . '.png'); $img = FabrikHelperHTML::image($imageName, 'list', '', $label); return '<a href="#" class="' . $name . ' listplugin" title="' . $label . '">' . $img . '<span>' . $label . '</span></a>'; } }
/** * Draws the html form element * * @param array $data to preopulate element with * @param int $repeatCounter repeat group counter * * @return string elements html */ public function render($data, $repeatCounter = 0) { FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE . 'media/com_fabrik/css/slider.css'); $name = $this->getHTMLName($repeatCounter); $id = $this->getHTMLId($repeatCounter); $params = $this->getParams(); $width = (int) $params->get('slider_width', 250); $element = $this->getElement(); $val = $this->getValue($data, $repeatCounter); if (!$this->isEditable()) { return $val; } $labels = array_filter(explode(',', $params->get('slider-labels'))); $str = array(); $str[] = '<div id="' . $id . '" class="fabrikSubElementContainer">'; FabrikHelperHTML::addPath(COM_FABRIK_BASE . 'plugins/fabrik_element/slider/images/', 'image', 'form', false); $outsrc = FabrikHelperHTML::image('clear_rating_out.png', 'form', $this->tmpl, array(), true); if ($params->get('slider-shownone')) { $str[] = '<div class="clearslider_cont"><img src="' . $outsrc . '" style="cursor:pointer;padding:3px;" alt="' . JText::_('PLG_ELEMENT_SLIDER_CLEAR') . '" class="clearslider" /></div>'; } $str[] = '<div class="slider_cont" style="width:' . $width . 'px;">'; if (count($labels) > 0) { $spanwidth = floor(($width - 2 * count($labels)) / count($labels)); $str[] = '<ul class="slider-labels" style="width:' . $width . 'px;">'; for ($i = 0; $i < count($labels); $i++) { if ($i == ceil(floor($labels) / 2)) { $align = 'center'; } switch ($i) { case 0: $align = 'left'; break; case 1: default: $align = 'center'; break; case count($labels) - 1: $align = 'right'; break; } $str[] = '<li style="width:' . $spanwidth . 'px;text-align:' . $align . ';">' . $labels[$i] . '</li>'; } $str[] = '</ul>'; } $str[] = '<div class="fabrikslider-line" style="width:' . $width . 'px">'; $str[] = '<div class="knob"></div>'; $str[] = '</div>'; $str[] = '<input type="hidden" class="fabrikinput" name="' . $name . '" value="' . $val . '" />'; $str[] = '<div class="slider_output">' . $val . '</div>'; $str[] = '</div>'; $str[] = '</div>'; return implode("\n", $str); }
public function button_result() { if ($this->canUse()) { $p = $this->onGetFilterKey_result(); FabrikHelperHTML::addPath('plugins/fabrik_list/' . $p . '/images/', 'image', 'list'); $name = $this->_getButtonName(); $label = $this->buttonLabel(); $imageName = $this->getParams()->get('list_' . $this->buttonPrefix . '_image_name', $this->buttonPrefix . '.png'); $img = FabrikHelperHTML::image($imageName, 'list', '', $label); return '<a href="#" class="' . $name . ' listplugin" title="' . $label . '">' . $img . '<span>' . $label . '</span></a>'; } return ''; }
/** * draws the form element * @param array data to preopulate element with * @param int repeat group counter * @return string returns element html */ function render($data, $repeatCounter = 0) { FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE.'media/com_fabrik/css/slider.css'); $name = $this->getHTMLName($repeatCounter); $id = $this->getHTMLId($repeatCounter); $params =& $this->getParams(); $width = $params->get('slider_width', 250); $element = $this->getElement(); $val = $this->getValue($data, $repeatCounter); if (!$this->_editable) { return $val; } $imagepath = COM_FABRIK_LIVESITE.'/plugins/fabrik_element/slider/images/'; $labels = array_filter(explode(',', $params->get('slider-labels'))); $str = "<div class=\"fabrikSubElementContainer\" id=\"$id\">"; FabrikHelperHTML::addPath(JPATH_SITE.'/plugins/fabrik_element/slider/images/', 'image', 'form', false); $outsrc = FabrikHelperHTML::image('clear_rating_out.png', 'form', $this->tmpl, '', true); if ($params->get('slider-shownone')) { $str .= "<div class=\"clearslider_cont\"><img src=\"$outsrc\" style=\"cursor:pointer;padding:3px;\" alt=\"clear\" class=\"clearslider\" /></div>"; } $str .="<div class=\"slider_cont\" style=\"width:{$width}px;\">\n"; if (count($labels) > 0) { $spanwidth = floor(($width - (2 * count($labels))) /count($labels)); $str .= "<ul class=\"slider-labels\" style=\"width:{$width}px;\">\n"; for ($i=0; $i < count($labels); $i++) { if ($i == ceil(floor($labels)/2)) { $align = 'center'; } switch($i) { case 0: $align = 'left'; break; case 1: default: $align = 'center'; break; case count($labels) -1: $align = 'right'; break; } $str .= "<li style=\"width:{$spanwidth}px;text-align:$align;\">".$labels[$i]."</li>\n"; } $str .= "</ul>\n"; } $str .= "<div class=\"fabrikslider-line\" style=\"width:{$width}px\">\n<div class=\"knob\"></div>\n</div>\n"; $str .= "<input type=\"hidden\" class=\"fabrikinput\" name=\"$name\" value=\"$val\"/>\n"; $str .= "<div class=\"slider_output\">$val</div>\n"; $str .= "</div>"; return $str; }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = 'default') { $app = JFactory::getApplication(); $input = $app->input; $j3 = FabrikWorker::j3(); $srcs = FabrikHelperHTML::framework(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model = $this->getModel(); $id = $input->getInt('id', $usersConfig->get('visualizationid', $input->getInt('visualizationid', 0))); $model->setId($id); $row = $model->getVisualization(); if (!$model->canView()) { echo FText::_('JERROR_ALERTNOAUTHOR'); return false; } $js = $model->render(); $this->containerId = $this->get('ContainerId'); $this->row = $row; $this->showFilters = $input->getInt('showfilters', 1) === 1 ? 1 : 0; $this->filters = $model->getFilters(); $this->advancedSearch = $model->getAdvancedSearchLink(); $this->filterFormURL = $model->getFilterFormURL(); $params = $model->getParams(); $this->params = $params; $this->width = $params->get('timeline_width', '700'); $this->height = $params->get('timeline_height', '300'); $tpl = $j3 ? 'bootstrap' : 'default'; $tpl = $params->get('timeline_layout', $tpl); $tmplpath = '/plugins/fabrik_visualization/timeline/views/timeline/tmpl/' . $tpl; $this->_setPath('template', JPATH_ROOT . $tmplpath); JHTML::stylesheet('media/com_fabrik/css/list.css'); FabrikHelperHTML::stylesheetFromPath($tmplpath . '/template.css'); $srcs['FbListFilter'] = 'media/com_fabrik/js/listfilter.js'; $srcs['Timeline'] = 'plugins/fabrik_visualization/timeline/timeline.js'; $srcs['AdvancedSearch'] = 'media/com_fabrik/js/advanced-search.js'; $js .= $model->getFilterJs(); FabrikHelperHTML::iniRequireJs($model->getShim()); FabrikHelperHTML::script($srcs, $js); JText::script('COM_FABRIK_ADVANCED_SEARCH'); JText::script('COM_FABRIK_LOADING'); $opts = array('alt' => 'calendar', 'class' => 'calendarbutton', 'id' => 'timelineDatePicker_cal_img'); $img = FabrikHelperHTML::image('calendar.png', 'form', @$this->tmpl, $opts); $this->datePicker = '<input type="text" name="timelineDatePicker" id="timelineDatePicker" value="" />' . $img; // Check and add a general fabrik custom css file overrides template css and generic table css FabrikHelperHTML::stylesheetFromPath('media/com_fabrik/css/custom.css'); // Check and add a specific biz template css file overrides template css generic table css and generic custom css FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/timeline/views/timeline/tmpl/' . $tpl . '/custom.css'); return parent::display(); }
/** * tagify a string * @param string to tagify * @return string tagified string */ protected function tagify($data) { $name = $this->getFullName(false, true, false); $params = $this->getParams(); $listModel = $this->getlistModel(); $filters = $listModel->getFilterArray(); $fkeys = JArrayHelper::getValue($filters, 'key', array()); $data = explode(",", strip_tags($data)); $tags = array(); $url = $params->get('textarea_tagifyurl'); if ($url == '') { $url = $_SERVER['REQUEST_URI']; $bits = explode('?', $url); $bits = JArrayHelper::getValue($bits, 1, '', 'string'); $bits = explode("&", $bits); foreach ($bits as $bit) { $parts = explode("=", $bit); if (count($parts) > 1) { $key = FabrikString::ltrimword(FabrikString::safeColNameToArrayKey($parts[0]), '&'); if ($key == $this->getFullName(false, true, false)) { $url = str_replace($key . '=' . $parts[1], '', $url); } } } } // $$$ rbo 24/02/2011 remove duplicates from tags $data = array_unique($data); $icon = FabrikHelperHTML::image('tag.png', 'form', @$this->tmpl, array('alt' => 'tag')); foreach ($data as $d) { $d = trim($d); if ($d != '') { if (trim($params->get('textarea_tagifyurl')) == '') { $qs = strstr($url, '?'); if (substr($url, -1) === '?') { $thisurl = "{$url}{$name}={$d}"; } else { $thisurl = strstr($url, '?') ? "{$url}&{$name}=" . urlencode($d) : "{$url}?{$name}=" . urlencode($d); } } else { $thisurl = str_replace('{tag}', urlencode($d), $url); } $tags[] = '<a href="' . $thisurl . '" class="fabrikTag">' . $icon . $d . '</a>'; } } return implode(" ", $tags); }
/** * Tagify a string * * @param string $data Tagify * * @return string Tagified string */ protected function tagify($data) { $name = $this->getFullName(true, false); $params = $this->getParams(); $data = explode(',', strip_tags($data)); $url = $params->get('textarea_tagifyurl'); $listId = $this->getListModel()->getId(); if ($url == '') { if ($this->app->isAdmin()) { $url = 'index.php?option=com_fabrik&task=list.view&listid=' . $listId; } else { $url = 'index.php?option=com_' . $this->package . '&view=list&listid=' . $listId; } } // $$$ rob 24/02/2011 remove duplicates from tags // $$$ hugh - strip spaces first, account for "foo,bar, baz, foo" $data = array_map('trim', $data); $data = array_unique($data); $img = FabrikWorker::j3() ? 'bookmark.png' : 'tag.png'; $icon = FabrikHelperHTML::image($img, 'form', @$this->tmpl, array('alt' => 'tag')); $tmplData = new stdClass(); $tmplData->tags = array(); foreach ($data as $d) { $d = trim($d); if ($d != '') { if (trim($params->get('textarea_tagifyurl')) == '') { if (substr($url, -1) === '?') { $thisurl = $url . $name . '[value]=' . $d; } else { $thisurl = strstr($url, '?') ? $url . '&' . $name . '[value]=' . urlencode($d) : $url . '?' . $name . '[value]=' . urlencode($d); } $thisurl .= '&' . $name . '[condition]=CONTAINS'; $thisurl .= '&resetfilters=1'; } else { $thisurl = str_replace('{tag}', urlencode($d), $url); } $o = new stdClass(); $o->url = $thisurl; $o->icon = $icon; $o->label = $d; $tmplData->tags[] = $o; } } $layout = $this->getLayout('tags'); return $layout->render($tmplData); }
/** * Execute and display a template script. * * @param string $tpl The name of the template file to parse; automatically searches through the template paths. * * @return mixed A string if successful, otherwise a JError object. */ public function display($tpl = 'default') { $srcs = FabrikHelperHTML::framework(); $usersConfig = JComponentHelper::getParams('com_fabrik'); $model = $this->getModel(); // Needed to load the language file! $pluginManager = FabrikWorker::getPluginManager(); $plugin = $pluginManager->getPlugIn('timeline', 'visualization'); $id = JRequest::getVar('id', $usersConfig->get('visualizationid', JRequest::getInt('visualizationid', 0))); $model->setId($id); $row = $model->getVisualization(); $js = $model->render(); $this->assign('containerId', $this->get('ContainerId')); $this->assignRef('row', $row); $this->assign('showFilters', JRequest::getInt('showfilters', 1) === 1 ? 1 : 0); $this->assignRef('filters', $this->get('Filters')); $this->advancedSearch = $this->get('AdvancedSearchLink'); $this->assign('filterFormURL', $this->get('FilterFormURL')); $params = $model->getParams(); $this->assignRef('params', $params); $this->width = $params->get('timeline_width', '700'); $this->height = $params->get('timeline_height', '300'); $tpl = $params->get('timeline_layout', $tpl); $tmplpath = '/plugins/fabrik_visualization/timeline/views/timeline/tmpl/' . $tpl; $this->_setPath('template', JPATH_ROOT . $tmplpath); JHTML::stylesheet('media/com_fabrik/css/list.css'); FabrikHelperHTML::stylesheetFromPath($tmplpath . '/template.css'); $srcs[] = 'media/com_fabrik/js/listfilter.js'; $srcs[] = 'plugins/fabrik_visualization/timeline/timeline.js'; $srcs[] = 'media/com_fabrik/js/advanced-search.js'; $srcs[] = 'media/com_fabrik/js/encoder.js'; $js .= $model->getFilterJs(); FabrikHelperHTML::script($srcs, $js); JText::script('COM_FABRIK_ADVANCED_SEARCH'); JText::script('COM_FABRIK_LOADING'); $opts = array('alt' => 'calendar', 'class' => 'calendarbutton', 'id' => 'timelineDatePicker_cal_img'); $img = FabrikHelperHTML::image('calendar.png', 'form', @$this->tmpl, $opts); $this->datePicker = '<input type="text" name="timelineDatePicker" id="timelineDatePicker" value="" />' . $img; // Check and add a general fabrik custom css file overrides template css and generic table css FabrikHelperHTML::stylesheetFromPath('media/com_fabrik/css/custom.css'); // Check and add a specific biz template css file overrides template css generic table css and generic custom css FabrikHelperHTML::stylesheetFromPath('plugins/fabrik_visualization/timeline/views/timeline/tmpl/' . $tpl . '/custom.css'); return parent::display(); }
/** * Draws the html form element * * @param array $data To pre-populate element with * @param int $repeatCounter Repeat group counter * * @return string elements html */ public function render($data, $repeatCounter = 0) { FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE . 'media/com_fabrik/css/slider.css'); $params = $this->getParams(); $width = (int) $params->get('slider_width', 250); $val = $this->getValue($data, $repeatCounter); if (!$this->isEditable()) { return $val; } $labels = explode(',', $params->get('slider-labels')); FabrikHelperHTML::addPath(COM_FABRIK_BASE . 'plugins/fabrik_element/slider/images/', 'image', 'form', false); $layout = $this->getLayout('form'); $layoutData = new stdClass(); $layoutData->id = $this->getHTMLId($repeatCounter); $layoutData->name = $this->getHTMLName($repeatCounter); $layoutData->value = $val; $layoutData->width = $width; $layoutData->j3 = FabrikWorker::j3(); $layoutData->showNone = $params->get('slider-shownone'); $layoutData->outSrc = FabrikHelperHTML::image('clear_rating_out.png', 'form', $this->tmpl, array(), true); $layoutData->labels = $labels; $layoutData->spanWidth = floor(($width - 2 * count($labels)) / count($labels)); $layoutData->align = array(); for ($i = 0; $i < count($labels); $i++) { switch ($i) { case 0: $align = 'left'; break; case count($labels) - 1: $align = 'right'; break; case 1: default: $align = 'center'; break; } $layoutData->align[] = $align; } return $layout->render($layoutData); }
/** * format the read only output for the page * @param string $value * @param string label * @return string value */ protected function getReadOnlyOutput($value, $label) { FabrikHelperHTML::addPath(JPATH_SITE . DS . 'plugins/fabrik_element/yesno/images/', 'image', 'form', false); $img = $value == '1' ? "1.png" : "0.png"; return FabrikHelperHTML::image($img, 'form', @$this->tmpl, array('alt' => $label)); }
<div class="colourpicker_output img-rounded" style="width:15px;height:15px;float:left;margin-right:10px;"></div> <?php echo FText::_('PLG_FABRIK_COLOURPICKER_COLOUR'); ?> <?php if ($d->j3) { ?> <a class="pull-right" href="#"> <?php echo FabrikHelperHTML::icon('icon-cancel icon-remove-sign'); ?> </a> <?php } else { echo FabrikHelperHTML::image("close.gif", 'form', @$this->tmpl, array()); } if ($d->showPicker) { ?> </div> <div class="itemContentPadder"> <div class="row-fluid"> <div class="span7"> <ul class="nav nav-tabs"> <li class="active"><a href="#<?php echo $d->id; ?> -picker" data-toggle="tab"><?php echo FText::_('PLG_FABRIK_COLOURPICKER_PICKER'); ?> </a></li>
/** * Create advanced search links * * @since 3.0.7 * * @return string */ public function getAdvancedSearchLink() { $app = JFactory::getApplication(); $package = $app->getUserState('com_fabrik.package', 'fabrik'); $links = array(); $listModels = $this->getlistModels(); $js = array(); $i = 0; foreach ($listModels as $listModel) { $params = $listModel->getParams(); if ($params->get('advanced-filter', '0')) { $table = $listModel->getTable(); $tmpl = $listModel->getTmpl(); $url = COM_FABRIK_LIVESITE . 'index.php?option=com_' . $package . '&view=list&layout=_advancedsearch&tmpl=component&listid=' . $table->id . '&nextview=' . $app->input->get('view', 'list') . '&scope&=' . $app->scope; $url .= '&tkn=' . JSession::getFormToken(); $links[$table->label] = $url; } } $title = '<span>' . FText::_('COM_FABRIK_ADVANCED_SEARCH') . '</span>'; $opts = array('alt' => FText::_('COM_FABRIK_ADVANCED_SEARCH'), 'class' => 'fabrikTip', 'opts' => "{notice:true}", 'title' => $title); $img = FabrikHelperHTML::image('find.png', 'list', '', $opts); if (count($links) === 1) { return '<a href="' . array_pop($links) . '" class="advanced-search-link">' . $img . '</a>'; } else { $str = $img . '<ul>'; foreach ($links as $label => $url) { $str .= '<li><a href="' . $url . '" class="advanced-search-link">' . $label . '</a></li>'; } $str = '</ul>'; } }
<?php if (array_key_exists('all', $this->filters)) { echo '<li>' . $this->filters['all']->element . '</li>'; } ?> <?php if ($this->filter_action != 'onchange') { ?> <li> <button class="fabrik_filter_submit button" value="<?php echo JText::_('COM_FABRIK_GO'); ?> " name="filter" > <?php echo FabrikHelperHTML::image('search.png', 'list', $this->tmpl); ?> </button> <!-- <input type="button" class="fabrik_filter_submit button" value="<?php echo JText::_('COM_FABRIK_GO'); ?> " name="filter" /> --> </li> <?php } ?> </ul> </div> <?php
/** * Build an object with the button icons based on the current tmpl * * @return void */ protected function buttons() { $model = $this->getModel(); $params = $model->getParams(); $this->buttons = new stdClass(); $buttonProperties = array('class' => 'fabrikTip', 'opts' => "{notice:true}", 'title' => '<span>' . JText::_('COM_FABRIK_EXPORT_TO_CSV') . '</span>'); $buttonProperties['alt'] = JText::_('COM_FABRIK_EXPORT_TO_CSV'); $this->buttons->csvexport = FabrikHelperHTML::image('csv-export.png', 'list', $this->tmpl, $buttonProperties); $buttonProperties['title'] = '<span>' . JText::_('COM_FABRIK_IMPORT_FROM_CSV') . '</span>'; $buttonProperties['alt'] = JText::_('COM_FABRIK_IMPORT_TO_CSV'); $this->buttons->csvimport = FabrikHelperHTML::image('csv-import.png', 'list', $this->tmpl, $buttonProperties); $buttonProperties['title'] = '<span>' . JText::_('COM_FABRIK_SUBSCRIBE_RSS') . '</span>'; $buttonProperties['alt'] = JText::_('COM_FABRIK_SUBSCRIBE_RSS'); $this->buttons->feed = FabrikHelperHTML::image('feed.png', 'list', $this->tmpl, $buttonProperties); $buttonProperties['title'] = '<span>' . JText::_('COM_FABRIK_EMPTY') . '</span>'; $buttonProperties['alt'] = JText::_('COM_FABRIK_EMPTY'); $this->buttons->empty = FabrikHelperHTML::image('trash.png', 'list', $this->tmpl, $buttonProperties); $buttonProperties['title'] = '<span>' . JText::_('COM_FABRIK_GROUP_BY') . '</span>'; $buttonProperties['alt'] = JText::_('COM_FABRIK_GROUP_BY'); $this->buttons->groupby = FabrikHelperHTML::image('group_by.png', 'list', $this->tmpl, $buttonProperties); unset($buttonProperties['title']); $buttonProperties['alt'] = JText::_('COM_FABRIK_FILTER'); $this->buttons->filter = FabrikHelperHTML::image('filter.png', 'list', $this->tmpl, $buttonProperties); $addLabel = $model->addLabel(); $buttonProperties['title'] = '<span>' . $addLabel . '</span>'; $buttonProperties['alt'] = $addLabel; $this->buttons->add = FabrikHelperHTML::image('plus-sign.png', 'list', $this->tmpl, $buttonProperties); $buttonProperties['title'] = '<span>' . JText::_('COM_FABRIK_PDF') . '</span>'; $buttonProperties['alt'] = JText::_('COM_FABRIK_PDF'); $this->buttons->pdf = FabrikHelperHTML::image('pdf.png', 'list', $this->tmpl, $buttonProperties); }
if ($group->canAddRepeat) { ?> <a class="addGroup" href="#"> <?php echo FabrikHelperHTML::image('plus-sign.png', 'form', $this->tmpl, array('class' => 'fabrikTip', 'title' => JText::_('COM_FABRIK_ADD_GROUP'))); ?> </a> <?php } ?> <?php if ($group->canDeleteRepeat) { ?> <a class="deleteGroup" href="#"> <?php echo FabrikHelperHTML::image('minus-sign.png', 'form', $this->tmpl, array('class' => 'fabrikTip', 'title' => JText::_('COM_FABRIK_DELETE_GROUP'))); ?> </a> <?php } ?> </div> <?php } ?> </div> <?php } } else { $this->elements = $group->elements; echo $this->loadTemplate('group');
public function approve() { $this->decide(1); echo FabrikHelperHTML::image('ok.png', 'list', ''); }
<div class="attachment"> <label> <?php echo FText::_('PLG_LIST_EMAIL_ATTACHMENTS'); ?> <br /> <input class="inputbox fabrikinput" name="attachment[]" type="file" id="attachment" /> </label> <a href="#" class="addattachment"> <?php echo FabrikHelperHTML::image('plus.png', 'form', @$this->tmpl, FText::_('COM_FABRIK_ADD')); ?> </a> <a href="#" class="delattachment"> <?php echo FabrikHelperHTML::image('minus-sign.png', 'form', @$this->tmpl, FText::_('COM_FABRIK_DELETE')); ?> </a> </div> <?php } ?> <div class="form-actions"> <input type="submit" id="submit" value="<?php echo FText::_('PLG_LIST_EMAIL_SEND'); ?> " class="button btn btn-primary" /> </div> <input type="hidden" name="option" value="com_fabrik" /> <input type="hidden" name="controller" value=list.email /> <input type="hidden" name="task" value="doemail" />
/** * 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); }
$this->elements = $subgroup; echo $this->loadTemplate('group'); ?> </div> <?php if ($group->editable) { ?> <div class="fabrikGroupRepeater"> <a class="addGroup" href="#"> <?php echo FabrikHelperHTML::image('add.png', 'form', $this->tmpl, array('class' => 'fabrikTip', 'opts' => "{notice:true}", 'title' => JText::_('COM_FABRIK_ADD_GROUP'))); ?> </a> <a class="deleteGroup" href="#"> <?php echo FabrikHelperHTML::image('del.png', 'form', $this->tmpl, array('class' => 'fabrikTip', 'opts' => "{notice:true}", 'title' => JText::_('COM_FABRIK_DELETE_GROUP'))); ?> </a> </div> <?php } ?> </div> <?php } } else { $this->elements = $group->elements; echo $this->loadTemplate('group'); } ?> </fieldset>
<div class="fabrikList" id="list_<?php echo $this->table->renderid; ?> " > <?php $gCounter = 0; foreach ($this->rows as $groupedby => $group) { ?> <?php if ($this->isGrouped) { ?> <div class="fabrik_groupheading"> <a href="#" class="toggle"> <?php echo FabrikHelperHTML::image('orderasc.png', 'list', $this->tmpl, JText::_('COM_FABRIK_TOGGLE')); ?> <span class="groupTitle"> <?php echo $this->grouptemplates[$groupedby]; ?> ( <?php echo count($group); ?> ) </span> </a> </div> <?php } ?>
?> </td> <td><?php echo $row['condition']; ?> </td> <td class='filtervalue'><?php echo $row['filter']; ?> </td> <td> <ul class="fabrik_action"> <li> <a class="advanced-search-remove-row" href="#"> <?php echo FabrikHelperHTML::image('del.png', 'list', $this->tmpl); ?> </a> </li> </ul> </td> </tr> <?php } ?> </tbody> <thead> <tr class="fabrik___heading title"> <th></th> <th><?php
<?php } ?> <?php if ($this->showPDF) { echo '<li>' . $this->pdfLink . '<li>'; } ?> <?php if ($this->emptyLink) { ?> <li> <a href="<?php echo $this->emptyLink; ?> " class="button doempty"/> <?php echo FabrikHelperHTML::image('trash.png', 'list', $this->tmpl, JText::_('COM_FABRIK_EMPTY')); ?> <span><?php echo JText::_('COM_FABRIK_EMPTY'); ?> </span> </a> </li> <?php } ?> </ul>
<?php if ($heading == 'po_spotlight___image') { if ($this->_row->data->{$heading} == '') { echo FabrikHelperHTML::image('image-grey.png', 'list', $this->tmpl, 'no image'); } else { $rawheading = $heading . "_raw"; $imgData = json_decode($this->_row->data->{$rawheading}); $this->xmlDoc = JFactory::getXML('Simple'); $ok = $this->xmlDoc->loadString('<xml>' . $this->_row->data->{$heading} . '</xml>'); if ($ok) { $img = $this->xmlDoc->document->getElementByPath('/a/img'); $title = htmlentities($img->toString(), ENT_QUOTES); } else { $title = 'not found'; } $file = $imgData[0]->file; //title="'.basename($file).'" echo '<a class="fabrikTip" opts="{position:\'left\'}" title="' . $title . '" rel="lightbox[]" href="' . COM_FABRIK_LIVESITE . $file . '">'; //class="fabrikLightBoxImage" echo FabrikHelperHTML::image('image.png', 'list', $this->tmpl, 'image'); echo '</a>'; } } else { echo @$this->_row->data->{$heading}; } ?> </td> <?php } ?> </tr>
/** * Shows the data formatted for the table view with format = pdf * note pdf lib doesn't support transparent PNGs hence this func * * @param string $data Cell data * @param object $thisRow Row data * * @return string formatted value */ public function renderListData_pdf($data, $thisRow) { FabrikHelperHTML::addPath(COM_FABRIK_BASE . 'plugins/fabrik_element/yesno/images/', 'image', 'list', false); $raw = $this->getFullName() . '_raw'; $data = $thisRow->{$raw}; $j3 = FabrikWorker::j3(); if ($data == '1') { $icon = $j3 ? 'checkmark.png' : '1_8bit.png'; return FabrikHelperHTML::image($icon, 'list', @$this->tmpl, array('alt' => FText::_('JYES'))); } else { $icon = $j3 ? 'remove.png' : '0_8bit.png'; return FabrikHelperHTML::image($icon, 'list', @$this->tmpl, array('alt' => FText::_('JNO'))); } }
?> </h1> <?php } echo $form->intro; ?> <div class="fabrikForm fabrikDetails" id="<?php echo $form->formid; ?> "> <?php echo $this->plugintop; // Error message $active = $form->error != '' ? '' : ' fabrikHide'; echo '<div class="fabrikMainError fabrikError' . $active . '">'; echo FabrikHelperHTML::image('alert.png', 'form', $this->tmpl); echo "{$form->error}</div>"; // Buttons if ($this->showEmail) { echo $this->emailLink; } if ($this->showPDF) { echo $this->pdfLink; } if ($this->showPrint) { echo $this->printLink; } // Related data template echo $this->loadTemplate('relateddata'); // Loop over the form's groups rendering them foreach ($this->groups as $group) {
?> <div class="button-group"> <a class="advanced-search-remove-row btn btn-danger" href="#"> <?php echo FabrikHelperHTML::image('minus.png', 'list', $this->tmpl); ?> </a> </div> <?php } else { ?> <ul class="fabrik_action"> <li> <a class="advanced-search-remove-row" href="#"> <?php echo FabrikHelperHTML::image('minus-sign.png', 'list', $this->tmpl); ?> </a> </li> </ul> <?php } ?> </td> </tr> <?php } ?> </tbody>
"> <?php echo FabrikHelperHTML::image('disapprove.png', 'visualization', ''); ?> <span>disapprove</span> </a> </li> </ul> </td> <td> <a href="<?php echo $row->view; ?> "> <?php echo FabrikHelperHTML::image('view.png', 'list', ''); ?> </a></td> </tr> <?php $i++; } ?> </tbody> </table> </div> <script type="text/javascript"> head.ready(function() { }); </script>