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


PHP FabrikWorker::canPdf方法代码示例

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


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

示例1: display


//.........这里部分代码省略.........
     if (!class_exists('JSite')) {
         require_once JPATH_ROOT . '/includes/application.php';
     }
     $app = JFactory::getApplication();
     $package = $app->getUserState('com_fabrik.package', 'fabrik');
     $this->setTitle($w, $params, $model);
     // Deprecated (keep in case people use them in old templates)
     $this->table = new stdClass();
     $this->table->label = FabrikString::translate($w->parseMessageForPlaceHolder($item->label, $_REQUEST));
     $this->table->intro = $params->get('show_into', 1) == 0 ? '' : FabrikString::translate($w->parseMessageForPlaceHolder($item->introduction));
     $this->table->outro = $params->get('show_outro', 1) == 0 ? '' : FabrikString::translate($w->parseMessageForPlaceHolder($params->get('outro')));
     $this->table->id = $item->id;
     $this->table->renderid = $model->getRenderContext();
     $this->table->db_table_name = $item->db_table_name;
     // End deprecated
     $this->list = $this->table;
     $this->list->class = $model->htmlClass();
     $this->group_by = $item->group_by;
     $this->form = new stdClass();
     $this->form->id = $item->form_id;
     $this->renderContext = $model->getRenderContext();
     $this->formid = 'listform_' . $this->renderContext;
     $form = $model->getFormModel();
     $this->table->action = $model->getTableAction();
     $this->showCSV = $model->canCSVExport();
     $this->showCSVImport = $model->canCSVImport();
     $this->toggleCols = $model->toggleCols();
     $this->showToggleCols = (bool) $params->get('toggle_cols', false);
     $this->canGroupBy = $model->canGroupBy();
     $this->navigation = $nav;
     $this->nav = $input->getInt('fabrik_show_nav', $params->get('show-table-nav', 1)) ? $nav->getListFooter($this->renderContext, $model->getTmpl()) : '';
     $this->nav = '<div class="fabrikNav">' . $this->nav . '</div>';
     $this->fabrik_userid = $user->get('id');
     $this->canDelete = $model->deletePossible() ? true : false;
     $this->limitLength = $model->limitLength;
     $this->ajax = $model->isAjax();
     // 3.0 observed in list.js & html moved into fabrik_actions rollover
     $this->showPDF = $params->get('pdf', $fbConfig->get('list_pdf', false));
     if ($this->showPDF) {
         FabrikWorker::canPdf();
     }
     $this->emptyLink = $model->canEmpty() ? '#' : '';
     $this->csvImportLink = $this->showCSVImport ? JRoute::_('index.php?option=com_' . $package . '&view=import&filetype=csv&listid=' . $item->id) : '';
     $this->showAdd = $model->canAdd();
     if ($this->showAdd) {
         if ($params->get('show-table-add', 1)) {
             $this->addRecordLink = $model->getAddRecordLink();
         } else {
             $this->showAdd = false;
         }
     }
     $this->addLabel = $model->addLabel();
     $this->showRSS = $params->get('rss', 0) == 0 ? 0 : 1;
     if ($this->showRSS) {
         $this->rssLink = $model->getRSSFeedLink();
         if ($this->rssLink != '') {
             $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
             $document->addHeadLink($this->rssLink, 'alternate', 'rel', $attribs);
         }
     }
     if ($app->isAdmin()) {
         // Admin always uses com_fabrik option
         $this->pdfLink = JRoute::_('index.php?option=com_fabrik&task=list.view&listid=' . $item->id . '&format=pdf&tmpl=component');
     } else {
         $pdfLink = 'index.php?option=com_' . $package . '&view=list&format=pdf&listid=' . $item->id;
         if (!$this->nodata) {
             // If some data is shown then ensure that menu links reset filters (combined with require filters) doesn't produce an empty data set for the pdf
             $pdfLink .= '&resetfilters=0';
         }
         $this->pdfLink = JRoute::_($pdfLink);
     }
     list($this->headings, $groupHeadings, $this->headingClass, $this->cellClass) = $model->getHeadings();
     $this->groupByHeadings = $model->getGroupByHeadings();
     $this->filter_action = $model->getFilterAction();
     JDEBUG ? $profiler->mark('fabrik getfilters start') : null;
     $this->filters = $model->getFilters('listform_' . $this->renderContext);
     $fKeys = array_keys($this->filters);
     $this->bootShowFilters = count($fKeys) === 1 && $fKeys[0] === 'all' ? false : true;
     $this->clearFliterLink = $model->getClearButton();
     JDEBUG ? $profiler->mark('fabrik getfilters end') : null;
     $this->filterMode = (int) $params->get('show-table-filters');
     $this->toggleFilters = $this->filterMode == 2 || $this->filterMode == 4;
     $this->showFilters = $model->getShowFilters();
     $this->filterCols = (int) $params->get('list_filter_cols', '1');
     $this->showClearFilters = $this->showFilters || $params->get('advanced-filter') ? true : false;
     $this->emptyDataMessage = $model->getEmptyDataMsg();
     $this->groupheadings = $groupHeadings;
     $this->calculations = $this->_getCalculations($this->headings);
     $this->isGrouped = !($model->getGroupBy() == '');
     $this->colCount = count($this->headings);
     $this->hasButtons = $model->getHasButtons();
     $this->grouptemplates = $model->groupTemplates;
     $this->params = $params;
     $this->loadTemplateBottom();
     $this->getManagementJS($this->rows);
     // Get dropdown list of other tables for quick nav in admin
     $this->tablePicker = $app->isAdmin() && $app->input->get('format') !== 'pdf' ? FabrikHelperHTML::tableList($this->table->id) : '';
     $this->buttons();
     $this->pluginTopButtons = $model->getPluginTopButtons();
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:101,代码来源:view.base.php

示例2: _addButtons

 /**
  * Add buttons to the view e.g. print, pdf
  *
  * @return  void
  */
 protected function _addButtons()
 {
     $input = $this->app->input;
     if ($input->get('format') === 'pdf') {
         // If we're rendering as PDF, no point showing any buttons
         $this->showEmail = false;
         $this->showPrint = false;
         $this->showPDF = false;
         return;
     }
     $fbConfig = JComponentHelper::getParams('com_fabrik');
     /** @var FabrikFEModelForm $model */
     $model = $this->getModel();
     $params = $model->getParams();
     $this->showEmail = $params->get('email', $fbConfig->get('form_email', 0));
     $this->emailLink = '';
     $this->printLink = '';
     $this->pdfLink = '';
     $this->pdfURL = '';
     $this->emailURL = '';
     $this->printURL = '';
     $this->showPrint = $params->get('print', $fbConfig->get('form_print', 0));
     if ($this->showPrint) {
         $text = FabrikHelperHTML::image('print.png');
         $this->printLink = '<a href="#" class="btn btn-default" class="printlink" onclick="window.print();return false;">' . $text . '</a>';
     }
     if ($input->get('tmpl') != 'component') {
         if ($this->showEmail) {
             $this->emailLink = FabrikHelperHTML::emailIcon($model, $params);
             $this->emailURL = FabrikHelperHTML::emailURL($model);
         }
         if ($this->showPrint) {
             $this->printLink = FabrikHelperHTML::printIcon($model, $params);
             $this->printURL = FabrikHelperHTML::printURL($model);
         }
     }
     $this->showPDF = $params->get('pdf', $fbConfig->get('form_pdf', false));
     if ($this->showPDF) {
         FabrikWorker::canPdf();
         if ($this->app->isAdmin()) {
             $this->pdfURL = 'index.php?option=com_' . $this->package . '&task=details.view&format=pdf&formid=' . $model->getId() . '&rowid=' . $model->getRowId();
         } else {
             $this->pdfURL = 'index.php?option=com_' . $this->package . '&view=details&formid=' . $model->getId() . '&rowid=' . $model->getRowId() . '&format=pdf';
         }
         $this->pdfURL = JRoute::_($this->pdfURL);
         $layout = FabrikHelperHTML::getLayout('form.fabrik-pdf-icon');
         $pdfDisplayData = new stdClass();
         $pdfDisplayData->pdfURL = $this->pdfURL;
         $pdfDisplayData->tmpl = $this->tmpl;
         $this->pdfLink = $layout->render($pdfDisplayData);
     }
 }
开发者ID:LGBGit,项目名称:tierno,代码行数:57,代码来源:view.base.php

示例3: _addButtons

 /**
  * Add buttons to the view e.g. print, pdf
  *
  * @return  void
  */
 protected function _addButtons()
 {
     $fbConfig = JComponentHelper::getParams('com_fabrik');
     $model = $this->getModel();
     $params = $model->getParams();
     $this->showEmail = $params->get('email', $fbConfig->get('form_email', 0));
     $this->emailLink = '';
     $this->printLink = '';
     $this->pdfLink = '';
     $this->pdfURL = '';
     $this->emailURL = '';
     $this->printURL = '';
     $this->showPrint = $params->get('print', $fbConfig->get('form_print', 0));
     if ($this->showPrint) {
         $text = JHTML::_('image.site', 'printButton.png', '/images/', null, null, JText::_('Print'));
         $this->printLink = '<a href="#" class="printlink" onclick="window.print();return false;">' . $text . '</a>';
     }
     if (JRequest::getVar('tmpl') != 'component') {
         if ($this->showEmail) {
             $this->emailLink = FabrikHelperHTML::emailIcon($model, $params);
             $this->emailURL = FabrikHelperHTML::emailURL($model);
         }
         if ($this->showPrint) {
             $this->printLink = FabrikHelperHTML::printIcon($model, $params, $model->_rowId);
             $this->printURL = FabrikHelperHTML::printURL($model);
         }
     }
     $this->showPDF = $params->get('pdf', $fbConfig->get('form_pdf', false));
     $buttonProperties = array('class' => 'fabrikTip', 'opts' => "{notice:true}", 'title' => '<span>' . JText::_('COM_FABRIK_PDF') . '</span>', 'alt' => JText::_('COM_FABRIK_PDF'));
     if ($this->showPDF) {
         if (!FabrikWorker::canPdf()) {
             JError::raiseNotice(500, JText::_('COM_FABRIK_NOTICE_DOMPDF_NOT_FOUND'));
         } else {
             $this->pdfURL = JRoute::_('index.php?option=com_fabrik&view=details&format=pdf&formid=' . $model->getId() . '&rowid=' . $model->_rowId);
             $this->pdfLink = '<a href="' . JRoute::_('index.php?option=com_fabrik&view=details&format=pdf&formid=' . $model->getId()) . '&rowid=' . $this->rowid . '">' . FabrikHelperHTML::image('pdf.png', 'list', $this->tmpl, $buttonProperties) . '</a>';
         }
     }
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:43,代码来源:view.base.php

示例4: _addButtons

 /**
  * Add buttons to the view e.g. print, pdf
  *
  * @return  void
  */
 protected function _addButtons()
 {
     $app = JFactory::getApplication();
     if ($app->input->get('format') === 'pdf') {
         // If we're rendering as PDF, no point showing any buttons
         $this->showEmail = false;
         $this->showPrint = false;
         $this->showPDF = false;
         return;
     }
     $fbConfig = JComponentHelper::getParams('com_fabrik');
     $package = $app->getUserState('com_fabrik.package', 'fabrik');
     $input = $app->input;
     $model = $this->getModel();
     $params = $model->getParams();
     $this->showEmail = $params->get('email', $fbConfig->get('form_email', 0));
     $this->emailLink = '';
     $this->printLink = '';
     $this->pdfLink = '';
     $this->pdfURL = '';
     $this->emailURL = '';
     $this->printURL = '';
     $this->showPrint = $params->get('print', $fbConfig->get('form_print', 0));
     if ($this->showPrint) {
         $text = FabrikHelperHTML::image('print.png');
         $this->printLink = '<a href="#" class="printlink" onclick="window.print();return false;">' . $text . '</a>';
     }
     if ($input->get('tmpl') != 'component') {
         if ($this->showEmail) {
             $this->emailLink = FabrikHelperHTML::emailIcon($model, $params);
             $this->emailURL = FabrikHelperHTML::emailURL($model);
         }
         if ($this->showPrint) {
             $this->printLink = FabrikHelperHTML::printIcon($model, $params, $model->getRowId());
             $this->printURL = FabrikHelperHTML::printURL($model);
         }
     }
     $this->showPDF = $params->get('pdf', $fbConfig->get('form_pdf', false));
     $buttonProperties = array('class' => 'fabrikTip', 'opts' => "{notice:true}", 'title' => '<span>' . FText::_('COM_FABRIK_PDF') . '</span>', 'alt' => FText::_('COM_FABRIK_PDF'));
     if ($this->showPDF) {
         FabrikWorker::canPdf();
         if ($app->isAdmin()) {
             $this->pdfURL = 'index.php?option=com_' . $package . '&task=details.view&format=pdf&formid=' . $model->getId() . '&rowid=' . $model->getRowId();
         } else {
             $this->pdfURL = 'index.php?option=com_' . $package . '&view=details&formid=' . $model->getId() . '&rowid=' . $model->getRowId() . '&format=pdf';
         }
         $this->pdfURL = JRoute::_($this->pdfURL);
         $this->pdfLink = '<a href="' . $this->pdfURL . '">' . FabrikHelperHTML::image('pdf.png', 'list', $this->tmpl, $buttonProperties) . '</a>';
     }
 }
开发者ID:ankaau,项目名称:GathBandhan,代码行数:55,代码来源:view.base.php

示例5: display


//.........这里部分代码省略.........
     $this->assign('requiredFiltersFound', $this->get('RequiredFiltersFound'));
     $this->assign('advancedSearch', $this->get('AdvancedSearchLink'));
     $this->nodata = empty($this->rows) || count($this->rows) == 1 && empty($firstRow) || !$this->requiredFiltersFound ? true : false;
     $this->tableStyle = $this->nodata ? 'display:none' : '';
     $this->emptyStyle = $this->nodata ? '' : 'display:none';
     $params = $model->getParams();
     if (!$model->canPublish()) {
         echo JText::_('COM_FABRIK_LIST_NOT_PUBLISHED');
         return false;
     }
     if (!$model->canView()) {
         echo JText::_('JERROR_ALERTNOAUTHOR');
         return false;
     }
     if (!class_exists('JSite')) {
         require_once JPATH_ROOT . '/includes/application.php';
     }
     $app = JFactory::getApplication();
     $this->setTitle($w, $params, $model);
     /** depreciated (keep incase ppl use them in old tmpls**/
     $this->table = new stdClass();
     $this->table->label = $w->parseMessageForPlaceHolder($item->label, $_REQUEST);
     $this->table->intro = $w->parseMessageForPlaceHolder($item->introduction);
     $this->table->outro = $w->parseMessageForPlaceHolder($params->get('outro'));
     $this->table->id = $item->id;
     $this->table->renderid = $this->get('RenderContext');
     $this->table->db_table_name = $item->db_table_name;
     /** end **/
     $this->assign('list', $this->table);
     $this->group_by = $item->group_by;
     $this->form = new stdClass();
     $this->form->id = $item->form_id;
     $this->assign('renderContext', $this->get('RenderContext'));
     $this->formid = 'listform_' . $this->renderContext;
     $form = $model->getFormModel();
     $this->table->action = $this->get('TableAction');
     $this->showCSV = $model->canCSVExport();
     $this->showCSVImport = $model->canCSVImport();
     $this->canGroupBy = $model->canGroupBy();
     $this->assignRef('navigation', $nav);
     $this->nav = JRequest::getInt('fabrik_show_nav', $params->get('show-table-nav', 1)) ? $nav->getListFooter($this->renderContext, $this->get('tmpl')) : '';
     $this->nav = '<div class="fabrikNav">' . $this->nav . '</div>';
     $this->fabrik_userid = $user->get('id');
     $this->canDelete = $model->deletePossible() ? true : false;
     // 3.0 observed in list.js & html moved into fabrik_actions rollover
     $canPdf = FabrikWorker::canPdf();
     $this->showPDF = $params->get('pdf', $fbConfig->get('list_pdf', false));
     if (!$canPdf && $this->showPDF) {
         JError::raiseNotice(500, JText::_('COM_FABRIK_NOTICE_DOMPDF_NOT_FOUND'));
     }
     $this->emptyLink = $model->canEmpty() ? '#' : '';
     $this->csvImportLink = $this->showCSVImport ? JRoute::_("index.php?option=com_fabrik&view=import&filetype=csv&listid=" . $item->id) : '';
     $this->showAdd = $model->canAdd();
     if ($this->showAdd) {
         if ($params->get('show-table-add', 1)) {
             $this->assign('addRecordLink', $this->get('AddRecordLink'));
         } else {
             $this->showAdd = false;
         }
     }
     $this->assign('addLabel', $params->get('addlabel', JText::_('COM_FABRIK_ADD')));
     $this->showRSS = $params->get('rss', 0) == 0 ? 0 : 1;
     if ($this->showRSS) {
         $this->rssLink = $model->getRSSFeedLink();
         if ($this->rssLink != '') {
             $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
             $document->addHeadLink($this->rssLink, 'alternate', 'rel', $attribs);
         }
     }
     if ($app->isAdmin()) {
         $this->pdfLink = JRoute::_('index.php?option=com_fabrik&task=list.view&listid=' . $item->id . '&format=pdf&tmpl=component');
     } else {
         $this->pdfLink = JRoute::_('index.php?option=com_fabrik&view=list&format=pdf&listid=' . $item->id);
     }
     list($this->headings, $groupHeadings, $this->headingClass, $this->cellClass) = $this->get('Headings');
     $this->assign('groupByHeadings', $this->get('GroupByHeadings'));
     $this->filter_action = $this->get('FilterAction');
     JDEBUG ? $profiler->mark('fabrik getfilters start') : null;
     $this->filters = $model->getFilters('listform_' . $this->renderContext);
     $this->assign('clearFliterLink', $this->get('clearButton'));
     JDEBUG ? $profiler->mark('fabrik getfilters end') : null;
     $this->assign('filterMode', (int) $params->get('show-table-filters'));
     $this->assign('toggleFilters', $this->filterMode == 2 || $this->filterMode == 4);
     $this->assign('showFilters', $this->get('showFilters'));
     $this->showClearFilters = $this->showFilters || $params->get('advanced-filter') ? true : false;
     $this->assign('emptyDataMessage', $this->get('EmptyDataMsg'));
     $this->assignRef('groupheadings', $groupHeadings);
     $this->calculations = $this->_getCalculations($this->headings, $model->actionMethod());
     $this->assign('isGrouped', !($this->get('groupBy') == ''));
     $this->assign('colCount', count($this->headings));
     $this->assign('hasButtons', $this->get('hasButtons'));
     $this->assignRef('grouptemplates', $model->groupTemplates);
     $this->assignRef('params', $params);
     $this->loadTemplateBottom();
     $this->getManagementJS($this->rows);
     // Get dropdown list of other tables for quick nav in admin
     $this->tablePicker = $app->isAdmin() && $app->input->get('format') !== 'pdf' ? FabrikHelperHTML::tableList($this->table->id) : '';
     $this->buttons();
     $this->assign('pluginTopButtons', $this->get('PluginTopButtons'));
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:101,代码来源:view.base.php


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