當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FabrikHelperHTML::stylesheet方法代碼示例

本文整理匯總了PHP中FabrikHelperHTML::stylesheet方法的典型用法代碼示例。如果您正苦於以下問題:PHP FabrikHelperHTML::stylesheet方法的具體用法?PHP FabrikHelperHTML::stylesheet怎麽用?PHP FabrikHelperHTML::stylesheet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在FabrikHelperHTML的用法示例。


在下文中一共展示了FabrikHelperHTML::stylesheet方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: display

 /**
  * Display
  *
  * @param   string  $tpl  Template
  *
  * @return  void
  */
 public function display($tpl = null)
 {
     FabrikHelperHTML::framework();
     $app = JFactory::getApplication();
     $input = $app->input;
     $state = $this->get('State');
     $item = $this->get('Item');
     $document = JFactory::getDocument();
     $srcs = array('media/com_fabrik/js/icons.js', 'media/com_fabrik/js/icongen.js', 'media/com_fabrik/js/canvas.js', 'media/com_fabrik/js/history.js', 'media/com_fabrik/js/keynav.js', 'media/com_fabrik/js/tabs.js', 'media/com_fabrik/js/pages.js', 'media/com_fabrik/js/frontpackage.js');
     FabrikHelperHTML::script($srcs);
     FabrikHelperHTML::stylesheet('media/com_fabrik/css/package.css');
     $canvas = $item->params->get('canvas');
     // $$$ rob 08/11/2011 test if component name set but still rendering
     // in option=com_fabrik then we should use fabrik as the package
     if ($input->get('option') === 'com_fabrik') {
         $item->component_name = 'fabrik';
     }
     $opts = JArrayHelper::getvalue($canvas, 'options', array());
     $tabs = JArrayHelper::getValue($canvas, 'tabs', array('Page 1'));
     $tabs = json_encode($tabs);
     $d = new stdClass();
     $layout = JArrayHelper::getValue($canvas, 'layout', $d);
     $layout = json_encode(JArrayHelper::getValue($canvas, 'layout', $d));
     $id = $this->get('State')->get('package.id');
     $script = "window.addEvent('fabrik.loaded', function() {\n\t\t\tnew FrontPackage({\n\t\ttabs : {$tabs},\n\t\ttabelement : 'packagemenu',\n\t\tpagecontainer : 'packagepages',\n\t\tlayout: {$layout},\n\t\t'packageId': {$id},\n\t\t'package':'{$item->component_name}'\n\t});\n\t\t});";
     FabrikHelperHTML::addScriptDeclaration($script);
     // Force front end templates
     $this->_basePath = COM_FABRIK_FRONTEND . '/views';
     $tmpl = !isset($item->template) ? 'default' : $item->template;
     $this->addTemplatePath($this->_basePath . '/' . $this->_name . '/tmpl/' . $tmpl);
     $text = $this->loadTemplate();
     FabrikHelperHTML::runConentPlugins($text);
     echo $text;
 }
開發者ID:ppantilla,項目名稱:bbninja,代碼行數:41,代碼來源:view.html.php

示例2: getBottomContent

    /**
     * Sets up HTML to be injected into the form's bottom
     *
     * @param   object  $params     params
     * @param   object  $formModel  form model
     *
     * @return void
     */
    public function getBottomContent($params, $formModel)
    {
        if (!$this->show($params, $formModel)) {
            return;
        }
        $app = JFactory::getApplication();
        $formId = $formModel->getForm()->id;
        $mode = JString::strtolower(JRequest::getCmd('view'));
        $this->ids = $this->getNavIds($formModel);
        $linkStartPrev = $this->ids->index == 0 ? ' disabled' : '';
        $linkNextEnd = $this->ids->index == $this->ids->lastKey ? ' disabled' : '';
        if ($app->isAdmin()) {
            $url = 'index.php?option=com_fabrik&view=' . $mode . '&formid=' . $formId . '&rowid=';
        } else {
            $url = 'index.php?option=com_fabrik&view=' . $mode . '&formid=' . $formId . '&rowid=';
        }
        $ajax = (bool) $params->get('paginate_ajax', true);
        $firstLink = $linkStartPrev ? '<span>&lt;&lt;</span>' . JText::_('COM_FABRIK_START') : '<a href="' . JRoute::_($url . $this->ids->first) . '" class="pagenav paginateFirst ' . $linkStartPrev . '"><span>&lt;&lt;</span>' . JText::_('COM_FABRIK_START') . '</a>';
        $prevLink = $linkStartPrev ? '<span>&lt;</span>' . JText::_('COM_FABRIK_PREV') : '<a href="' . JRoute::_($url . $this->ids->prev) . '" class="pagenav paginatePrevious ' . $linkStartPrev . '"><span>&lt;</span>' . JText::_('COM_FABRIK_PREV') . '</a>';
        $nextLink = $linkNextEnd ? JText::_('COM_FABRIK_NEXT') . '<span>&gt;</span>' : '<a href="' . JRoute::_($url . $this->ids->next) . '" class="pagenav paginateNext' . $linkNextEnd . '">' . JText::_('COM_FABRIK_NEXT') . '<span>&gt;</span></a>';
        $endLink = $linkNextEnd ? JText::_('COM_FABRIK_END') . '<span>&gt;&gt;</span>' : '<a href="' . JRoute::_($url . $this->ids->last) . '" class="pagenav paginateLast' . $linkNextEnd . '">' . JText::_('COM_FABRIK_END') . '<span>&gt;&gt;</span></a>';
        $this->_data = '<ul id="fabrik-from-pagination" class="pagination">
				<li>' . $firstLink . '</li>
				<li>' . $prevLink . '</li>
				<li>' . $nextLink . '</li>
				<li>' . $endLink . '</li>
		</ul>';
        FabrikHelperHTML::stylesheet('plugins/fabrik_form/paginate/paginate.css');
        return true;
    }
開發者ID:rogeriocc,項目名稱:fabrik,代碼行數:38,代碼來源:paginate.php

示例3: render

 /**
  * 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);
 }
開發者ID:rogeriocc,項目名稱:fabrik,代碼行數:61,代碼來源:slider.php

示例4: render

	/**
	 * 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;
	}
開發者ID:Jobar87,項目名稱:fabrik,代碼行數:58,代碼來源:slider.php

示例5: render

 /**
  * 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);
 }
開發者ID:jfquestiaux,項目名稱:fabrik,代碼行數:48,代碼來源:slider.php

示例6: render

 /**
  * 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)
 {
     $values = $this->getSubOptionValues();
     $labels = $this->getSubOptionLabels();
     $selected = (array) $this->getValue($data, $repeatCounter);
     $i = 0;
     $to = array();
     $from = array();
     foreach ($values as $v) {
         if (!in_array($v, $selected)) {
             $from[$v] = $labels[$i];
         }
         $i++;
     }
     $i = 0;
     $lookup = array_flip($values);
     foreach ($selected as $v) {
         if ($v == '' || $v == '-' || $v == '[""]') {
             continue;
         }
         $k = FArrayHelper::getValue($lookup, $v);
         $tmpTxt = addslashes(htmlspecialchars(FArrayHelper::getValue($labels, $k)));
         $to[$v] = $tmpTxt;
         $i++;
     }
     if (!$this->isEditable()) {
         return implode(', ', $to);
     }
     FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE . 'plugins/fabrik_element/picklist/picklist.css');
     $layout = $this->getLayout('form');
     $layoutData = new stdClass();
     $layoutData->id = $this->getHTMLId($repeatCounter);
     $layoutData->errorCSS = $this->elementError != '' ? ' elementErrorHighlight' : '';
     $layoutData->from = $from;
     $layoutData->to = $to;
     $layoutData->name = $this->getHTMLName($repeatCounter);
     $layoutData->value = json_encode($selected);
     $layoutData->addOptionsUi = $this->getAddOptionFields($repeatCounter);
     return $layout->render($layoutData);
 }
開發者ID:jfquestiaux,項目名稱:fabrik,代碼行數:48,代碼來源:picklist.php

示例7: display

 function display($tpl = null)
 {
     FabrikHelperHTML::framework();
     $state = $this->get('State');
     $item = $this->get('Item');
     $document = JFactory::getDocument();
     FabrikHelperHTML::script('media/com_fabrik/js/icons.js', true);
     FabrikHelperHTML::script('media/com_fabrik/js/icongen.js', true);
     FabrikHelperHTML::script('media/com_fabrik/js/canvas.js', true);
     FabrikHelperHTML::script('media/com_fabrik/js/history.js', true);
     FabrikHelperHTML::script('media/com_fabrik/js/keynav.js', true);
     FabrikHelperHTML::script('media/com_fabrik/js/tabs.js', true);
     FabrikHelperHTML::script('media/com_fabrik/js/pages.js', true);
     FabrikHelperHTML::script('media/com_fabrik/js/frontpackage.js', true);
     FabrikHelperHTML::stylesheet('media/com_fabrik/css/package.css');
     $canvas = $item->params->get('canvas');
     $opts = JArrayHelper::getvalue($canvas, 'options', array());
     $tabs = JArrayHelper::getValue($canvas, 'tabs', array('Page 1'));
     $tabs = json_encode($tabs);
     $d = new stdClass();
     $layout = JArrayHelper::getValue($canvas, 'layout', $d);
     $layout = json_encode(JArrayHelper::getValue($canvas, 'layout', $d));
     $id = $this->get('State')->get('package.id');
     $script = "head.ready(function() {\r\n\t\t\tnew FrontPackage({\r\n\t\ttabs : {$tabs},\r\n\t\ttabelement : 'packagemenu',\r\n\t\tpagecontainer : 'packagepages',\r\n\t\tlayout: {$layout},\r\n\t\t'packageid':{$id},\r\n\t\t'package':'{$item->component_name}'\r\n\t});\r\n\t\t});";
     $document->addScriptDeclaration($script);
     //force front end templates
     $this->_basePath = COM_FABRIK_FRONTEND . DS . 'views';
     $tmpl = !isset($item->template) ? 'default' : $item->template;
     $this->addTemplatePath($this->_basePath . DS . $this->_name . DS . 'tmpl' . DS . $tmpl);
     $text = $this->loadTemplate();
     $opt = JRequest::getVar('option');
     JRequest::setVar('option', 'com_content');
     jimport('joomla.html.html.content');
     $text .= '{emailcloak=off}';
     $text = JHTML::_('content.prepare', $text);
     $text = preg_replace('/\\{emailcloak\\=off\\}/', '', $text);
     JRequest::setVar('option', $opt);
     echo $text;
 }
開發者ID:juliano-hallac,項目名稱:fabrik,代碼行數:39,代碼來源:view.html.php

示例8: stylesheetFromPath

 /**
  * check for a custom css file and include it if it exists
  * @param string $path NOT including JPATH_SITE (so relative too root dir
  * @return failse
  */
 function stylesheetFromPath($path)
 {
     if (JFile::exists(JPATH_SITE . DS . $path)) {
         $parts = explode(DS, $path);
         $file = array_pop($parts);
         $path = implode('/', $parts) . '/';
         FabrikHelperHTML::stylesheet($path . $file);
     }
 }
開發者ID:nickbunyan,項目名稱:fabrik,代碼行數:14,代碼來源:html.php

示例9: plupload

 /**
  * Create the html for Ajax upload widget
  *
  * @param   array  $str            Current html output
  * @param   int    $repeatCounter  Repeat group counter
  * @param   array  $values         Existing files
  *
  * @return	array	Modified file-upload html
  */
 protected function plupload($str, $repeatCounter, $values)
 {
     FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE . 'media/com_fabrik/css/slider.css');
     $params = $this->getParams();
     $w = (int) $params->get('ajax_dropbox_width', 0);
     $h = (int) $params->get('ajax_dropbox_height', 200);
     $dropBoxStyle = 'height:' . $h . 'px;';
     if ($w !== 0) {
         $dropBoxStyle .= 'width:' . $w . 'px;';
     }
     $layout = $this->getLayout('widget');
     $displayData = new stdClass();
     $displayData->id = $this->getHTMLId($repeatCounter);
     $displayData->winWidth = $params->get('win_width', 400);
     $displayData->winHeight = $params->get('win_height', 400);
     $displayData->canCrop = $this->canCrop();
     $displayData->canvasSupport = FabrikHelperHTML::canvasSupport();
     $displayData->dropBoxStyle = $dropBoxStyle;
     $displayData->field = implode("\n", $str);
     $displayData->j3 = FabrikWorker::j3();
     $str = (array) $layout->render($displayData);
     FabrikHelperHTML::jLayoutJs('fabrik-progress-bar', 'fabrik-progress-bar', (object) array('context' => '', 'animated' => true));
     FabrikHelperHTML::jLayoutJs('fabrik-progress-bar-success', 'fabrik-progress-bar', (object) array('context' => 'success', 'value' => 100));
     FabrikHelperHTML::jLayoutJs('fabrik-icon-delete', 'fabrik-icon', (object) array('icon' => 'delete'), array('debug' => true));
     return $str;
 }
開發者ID:LGBGit,項目名稱:tierno,代碼行數:35,代碼來源:fileupload.php

示例10: getBottomContent

    /**
     * Sets up HTML to be injected into the form's bottom
     *
     * @return void
     */
    public function getBottomContent()
    {
        /** @var FabrikFEModelForm $formModel */
        $formModel = $this->getModel();
        if (!$this->show()) {
            $this->data = '';
            return;
        }
        $j3 = FabrikWorker::j3();
        $input = $this->app->input;
        $formId = $formModel->getForm()->id;
        $mode = JString::strtolower($input->get('view', 'form'));
        $this->ids = $this->getNavIds();
        $linkStartPrev = $this->ids->index == 0 ? ' disabled' : '';
        $linkNextEnd = $this->ids->index == $this->ids->lastKey ? ' disabled' : '';
        if ($this->app->isAdmin()) {
            $url = 'index.php?option=com_fabrik&task=' . $mode . '.view&formid=' . $formId . '&rowid=';
        } else {
            $url = 'index.php?option=com_' . $this->package . '&view=' . $mode . '&formid=' . $formId . '&rowid=';
        }
        $links = array();
        $links['first'] = JRoute::_($url . $this->ids->first);
        $links['first-active'] = $linkStartPrev;
        $links['last-active'] = $linkNextEnd;
        $links['prev'] = JRoute::_($url . $this->ids->prev);
        $links['next'] = JRoute::_($url . $this->ids->next);
        $links['last'] = JRoute::_($url . $this->ids->last);
        if ($j3) {
            $layout = new JLayoutFile('plugins.fabrik_form.paginate.layouts.default_paginate', JPATH_SITE);
            $this->data = $layout->render($links);
        } else {
            $firstLink = $linkStartPrev ? '<span>&lt;&lt;</span>' . FText::_('COM_FABRIK_START') : '<a href="' . $links['first'] . '" class="pagenav paginateFirst ' . $linkStartPrev . '"><span>&lt;&lt;</span>' . FText::_('COM_FABRIK_START') . '</a>';
            $prevLink = $linkStartPrev ? '<span>&lt;</span>' . FText::_('COM_FABRIK_PREV') : '<a href="' . $links['prev'] . '" class="pagenav paginatePrevious ' . $linkStartPrev . '"><span>&lt;</span>' . FText::_('COM_FABRIK_PREV') . '</a>';
            $nextLink = $linkNextEnd ? FText::_('COM_FABRIK_NEXT') . '<span>&gt;</span>' : '<a href="' . $links['next'] . '" class="pagenav paginateNext' . $linkNextEnd . '">' . FText::_('COM_FABRIK_NEXT') . '<span>&gt;</span></a>';
            $endLink = $linkNextEnd ? FText::_('COM_FABRIK_END') . '<span>&gt;&gt;</span>' : '<a href="' . $links['last'] . '" class="pagenav paginateLast' . $linkNextEnd . '">' . FText::_('COM_FABRIK_END') . '<span>&gt;&gt;</span></a>';
            $this->data = '<ul id="fabrik-from-pagination" class="pagination">
					<li>' . $firstLink . '</li>
					<li>' . $prevLink . '</li>
					<li>' . $nextLink . '</li>
					<li>' . $endLink . '</li>
			</ul>';
        }
        FabrikHelperHTML::stylesheet('plugins/fabrik_form/paginate/paginate.css');
    }
開發者ID:jfquestiaux,項目名稱:fabrik,代碼行數:49,代碼來源:paginate.php

示例11: getListCss

 /**
  * @since 3.0 loads lists's css files
  * Checks : J template html override css file then fabrik list tmpl template css file. Including them if found
  */
 public function getListCss()
 {
     $tmpl = $this->getTmpl();
     $app = JFactory::getApplication();
     /* check for a form template file (code moved from view) */
     if ($tmpl != '') {
         $qs = '?c=' . $this->getRenderContext();
         $qs .= '&amp;buttoncount=' . $this->rowActionCount;
         if (JFile::exists(JPATH_THEMES . '/' . $app->getTemplate() . '/html/com_fabrik/list/' . $tmpl . '/template_css.php')) {
             FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE . 'templates/' . $app->getTemplate() . '/html/com_fabrik/list/' . $tmpl . '/template_css.php' . $qs);
         } else {
             FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE . 'components/com_fabrik/views/list/tmpl/' . $tmpl . '/template_css.php' . $qs);
         }
     }
 }
開發者ID:rw1,項目名稱:fabrik,代碼行數:19,代碼來源:list.php

示例12: cck

 /**
  * CCK - not used atm
  *
  * @return void
  */
 public function cck()
 {
     $catid = JRequest::getInt('catid');
     $db = JFactory::getDBO();
     $db->setQuery('SELECT id FROM #__fabrik_forms WHERE params LIKE \'%"cck_category":"' . $catid . '"%\'');
     $id = $db->loadResult();
     if (!$id) {
         FabrikHelperHTML::stylesheet('system.css', 'administrator/templates/system/css/');
         echo "<a target=\"_blank\" href=\"index.php?option=com_fabrik&c=form\">" . JText::_('VIEW_FORMS') . "</a>";
         return JError::raiseNotice(500, JText::_('SET_FORM_CCK_CATEGORY'));
     }
     JRequest::setVar('formid', $id);
     // Tell fabrik to load js scripts normally
     JRequest::setVar('iframe', 1);
     $this->view();
 }
開發者ID:rogeriocc,項目名稱:fabrik,代碼行數:21,代碼來源:form.php

示例13: onMakeFilters

 /**
  * Build the radius search HTML
  *
  * @param   array  &$args  Plugin args
  *
  * @return  void
  */
 public function onMakeFilters(&$args)
 {
     if (!is_object($this->getMapElement())) {
         return;
     }
     $model = $this->getModel();
     $params = $this->getParams();
     $f = new stdClass();
     $f->label = FText::_($params->get('radius_label', 'Radius search'));
     FabrikHelperHTML::stylesheet('plugins/fabrik_list/radius_search/radius_search.css');
     $layoutData = new stdClass();
     $layoutData->renderOrder = $this->renderOrder;
     $layoutData->baseContext = $this->getSessionContext();
     $layoutData->defaultSearch = $params->get('default_search', 'mylocation');
     $layoutData->geocodeDefault = $params->get('geocode_default', '');
     $layoutData->unit = $this->getParams()->get('radius_unit', 'km');
     $layoutData->distance = $this->getValue();
     $layoutData->startActive = $params->get('start_active', 0);
     $typeKey = $layoutData->baseContext . 'radius_search_type' . $this->renderOrder;
     $type = $this->app->getUserStateFromRequest($typeKey, 'radius_search_type' . $this->renderOrder, array($layoutData->defaultSearch));
     $layoutData->select = $this->searchSelectList($type);
     $layoutData->type = $type[0];
     list($layoutData->searchLatitude, $layoutData->searchLongitude) = $this->getSearchLatLon();
     $layoutData->geocodeAsYouType = $params->get('geocode_as_type', 1);
     $layoutData->hasGeocode = $params->get('geocode', 1) == 1;
     $layoutData->address = $address = $this->app->getUserStateFromRequest($layoutData->baseContext . 'geocode' . $this->renderOrder, 'radius_search_geocode_field' . $this->renderOrder);
     $lat = $this->app->getUserStateFromRequest($layoutData->baseContext . 'lat' . $this->renderOrder, 'radius_search_lat' . $this->renderOrder);
     $lon = $this->app->getUserStateFromRequest($layoutData->baseContext . 'lon' . $this->renderOrder, 'radius_search_lon' . $this->renderOrder);
     $o = FabrikString::mapStrToCoords($layoutData->geocodeDefault);
     $layoutData->defaultLat = $lat ? $lat : (double) $o->lat;
     $layoutData->defaultLon = $lon ? $lon : (double) $o->long;
     $layoutData->defaultZoom = (int) $o->zoom === 0 ? 7 : (int) $o->zoom;
     $layoutData->lat = $lat;
     $layoutData->lon = $lon;
     $active = $this->app->getUserStateFromRequest($layoutData->baseContext . 'radius_search_active', 'radius_search_active' . $this->renderOrder, array($layoutData->startActive));
     $layoutData->active = $active[0];
     $layout = $this->getLayout('filters');
     $str = $layout->render($layoutData);
     $f->element = $str;
     $f->required = '';
     if ($this->app->input->get('format') !== 'raw') {
         FabrikHelperHTML::addStyleDeclaration("table.radius_table{border-collapse:collapse;border:0;}\n\t\t\ttable.radius_table td{border:0;}");
     }
     JText::script('PLG_VIEW_RADIUS_NO_GEOLOCATION_AVAILABLE');
     JText::script('COM_FABRIK_SEARCH');
     JText::script('PLG_LIST_RADIUS_SEARCH');
     JText::script('PLG_LIST_RADIUS_SEARCH_BUTTON');
     $mapElement = $this->getMapElement();
     $mapName = $mapElement->getFullName(true, false);
     $model->viewfilters[$mapName] = $f;
 }
開發者ID:jfquestiaux,項目名稱:fabrik,代碼行數:58,代碼來源:radius_search.php

示例14: getListCss

 /**
  * @since 3.0 loads lists's css files
  * Checks : J template html override css file then fabrik list tmpl template css file. Including them if found
  */
 public function getListCss()
 {
     $tmpl = $this->getTmpl();
     $app = JFactory::getApplication();
     /* check for a form template file (code moved from view) */
     if ($tmpl != '') {
         if (JFile::exists(JPATH_THEMES . '/' . $app->getTemplate() . '/html/com_fabrik/list/' . $tmpl . '/template_css.php')) {
             FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE . 'templates/' . $app->getTemplate() . '/html/com_fabrik/list/' . $tmpl . '/template_css.php?c=' . $this->getId());
         } else {
             FabrikHelperHTML::stylesheet(COM_FABRIK_LIVESITE . "components/com_fabrik/views/list/tmpl/" . $tmpl . "/template_css.php?c=" . $this->getId());
         }
     }
 }
開發者ID:juliano-hallac,項目名稱:fabrik,代碼行數:17,代碼來源:list.php

示例15: getManagementJS

 protected function getManagementJS($data = array())
 {
     global $Itemid;
     // $$$ rob ALWAYS load the calendar (so its avaible in ajax forms)
     FabrikHelperHTML::loadcalendar();
     $app =& JFactory::getApplication();
     $model =& $this->getModel();
     $table =& $model->getTable();
     $formModel =& $model->getForm();
     $elementsNotInTable =& $formModel->getElementsNotInTable();
     $keys = array('id' => '', 'name' => '', 'label' => '');
     foreach ($elementsNotInTable as &$i) {
         if (is_a($i, 'TableElement')) {
             $i = array_intersect_key($i->getPublicProperties(), $keys);
         }
     }
     FabrikHelperHTML::packageJS();
     $document =& JFactory::getDocument();
     if ($model->requiresSlimbox()) {
         FabrikHelperHTML::slimbox();
     }
     if ($model->requiresMocha()) {
         FabrikHelperHTML::mocha();
     }
     FabrikHelperHTML::script('table.js', 'media/com_fabrik/js/', true);
     $tmpl = $this->getTmpl();
     FabrikHelperHTML::stylesheet('table.css', 'media/com_fabrik/css/');
     // check for a custom css file and include it if it exists
     FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "template.css");
     //check and add a general fabrik custom css file overrides template css and generic table css
     FabrikHelperHTML::stylesheetFromPath("media" . DS . "com_fabrik" . DS . "css" . DS . "custom.css");
     //check and add a specific table template css file overrides template css generic table css and generic custom css
     FabrikHelperHTML::stylesheetFromPath("components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "custom.css");
     // check for a custom js file and include it if it exists
     $aJsPath = JPATH_SITE . DS . "components" . DS . "com_fabrik" . DS . "views" . DS . "table" . DS . "tmpl" . DS . $tmpl . DS . "javascript.js";
     if (JFile::exists($aJsPath)) {
         FabrikHelperHTML::script("javascript.js", 'components/com_fabrik/views/table/tmpl/' . $tmpl . '/', true);
     }
     $origRows = $this->rows;
     $this->rows = array(array());
     $tmpItemid = !isset($Itemid) ? 0 : $Itemid;
     $this->_c = 0;
     $this->_row = new stdClass();
     $script = '';
     // $$$ rob done in HTMLHelper
     //$script = "/* <![CDATA[ */ \n";
     static $tableini;
     if (!$tableini) {
         $tableini = true;
         $script .= "var oTables = \$H();\n";
     }
     $opts = new stdClass();
     $opts->admin = $app->isAdmin();
     $opts->postMethod = $model->getPostMethod();
     $opts->filterMethod = $this->filter_action;
     $opts->form = 'tableform_' . $model->_id;
     $opts->headings = $model->_jsonHeadings();
     $labels = $this->headings;
     foreach ($labels as &$l) {
         $l = strip_tags($l);
     }
     $opts->labels = $labels;
     $opts->primaryKey = $table->db_primary_key;
     $opts->Itemid = $tmpItemid;
     $opts->formid = $model->_oForm->getId();
     $opts->canEdit = $model->canEdit() ? "1" : "0";
     $opts->canView = $model->canView() ? "1" : "0";
     $opts->page = JRoute::_('index.php');
     $opts->isGrouped = $this->isGrouped;
     $opts->mooversion = FabrikWorker::getMooVersion() == 1 ? 1.2 : 1.1;
     if (FabrikWorker::nativeMootools12()) {
         $opts->mooversion = 1.24;
     }
     $opts->formels = $elementsNotInTable;
     //if table data starts as empty then we need the html from the row
     // template otherwise we can't add a row to the table
     if ($model->_postMethod == 'ajax') {
         ob_start();
         $this->_row = new stdClass();
         $this->_row->id = '';
         $this->_row->class = 'fabrik_row';
         require COM_FABRIK_FRONTEND . DS . 'views' . DS . 'table' . DS . 'tmpl' . DS . 'default' . DS . 'default_row.php';
         $opts->rowtemplate = ob_get_contents();
         ob_end_clean();
     }
     //$$$rob if you are loading a table in a window from a form db join select record option
     // then we want to know the id of the window so we can set its showSpinner() method
     $opts->winid = JRequest::getVar('winid', '');
     $opts->ajaxEditViewLink = $model->ajaxEditViewLink() ? 1 : 0;
     $opts = json_encode($opts);
     $lang = new stdClass();
     $lang->select_rows = JText::_('SELECT SOME ROWS FOR DELETION');
     $lang->yes = JText::_('Yes');
     $lang->no = JText::_('No');
     $lang->select_colums_to_export = JText::_('SELECT_COLUMNS_TO_EXPORT');
     $lang->include_filters = JText::_('INCLUDE_FILTERS');
     $lang->include_data = JText::_('INCLUDE_DATA');
     $lang->inlcude_raw_data = JText::_('INCLUDE_RAW_DATA');
     $lang->include_calculations = JText::_('INLCUDE_CALCULATIONS');
     $lang->export = JText::_('EXPORT');
//.........這裏部分代碼省略.........
開發者ID:nikshade,項目名稱:fabrik21,代碼行數:101,代碼來源:view.html.php


注:本文中的FabrikHelperHTML::stylesheet方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。