public function display($tpl = null)
 {
     $this->option = JFactory::getApplication()->input->get('option');
     $this->state = $this->get('State');
     $this->form = $this->get('Form');
     $this->importType = $this->state->get('import.context');
     switch ($this->importType) {
         case 'locations':
             $this->legend = JText::_('COM_SOCIALCOMMUNITY_IMPORT_LOCATIONS_DATA');
             $this->uploadTask = 'import.locations';
             break;
         case 'countries':
             $this->legend = JText::_('COM_SOCIALCOMMUNITY_IMPORT_COUNTRIES_DATA');
             $this->uploadTask = 'import.countries';
             break;
         case 'states':
             $this->legend = JText::_('COM_SOCIALCOMMUNITY_IMPORT_STATES_DATA');
             $this->uploadTask = 'import.states';
             break;
         default:
             // Currencies
             $this->legend = JText::_('COM_SOCIALCOMMUNITY_IMPORT_CURRENCY_DATA');
             $this->uploadTask = 'import.currencies';
             break;
     }
     // Add submenu
     SocialCommunityHelper::addSubmenu($this->importType);
     // Prepare actions
     $this->addToolbar();
     $this->setDocument();
     parent::display($tpl);
 }
Example #2
0
 /**
  * Execute and display a template script.
  *
  * @param   string $tpl The name of the template file to parse; automatically searches through the template paths.
  *
  * @throws  Exception
  *
  * @return  mixed  A string if successful, otherwise a Error object.
  *
  * @see     JViewLegacy::loadTemplate()
  * @since   1.0
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     if (!$app->input->get('id', 0, 'int')) {
         $app->redirect(JRoute::_('index.php?view=visibilities'), JText::_('JGLOBAL_RESOURCE_NOT_FOUND'), 'error');
     }
     // Get data from the model
     $this->state = $this->get('State');
     $this->item = $this->get('Item');
     if (!$this->item) {
         $app->redirect(JRoute::_('index.php?view=visibilities'), JText::_('JGLOBAL_RESOURCE_NOT_FOUND'), 'error');
     }
     $this->params = $this->state->get('params');
     /** @var SichtweitenModelVisibilities $visibilities_model */
     $visibilities_model = JModelLegacy::getInstance('Visibilities', 'SichtweitenModel');
     $this->vis_state = $visibilities_model->getState();
     $this->vis_state->set('filter.period', 0);
     $this->vis_state->set('filter.location', (int) $this->item->id);
     if ($this->vis_state->get('list.ordering') == 'g.displayName') {
         $this->vis_state->set('list.ordering', 'datum');
         $this->vis_state->set('list.direction', 'DESC');
     }
     $this->items = $visibilities_model->getItems();
     $this->pagination = $visibilities_model->getPagination();
     parent::display($tpl);
 }
Example #3
0
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     UserIdeasHelper::addSubmenu($this->getName());
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array("archived" => false, "trash" => false)), 'value', 'text', $this->state->get('filter.state'), true));
     $this->sidebar = JHtmlSidebar::render();
 }
Example #4
0
 public function display($tpl = null)
 {
     $this->version = new CrowdfundingFinance\Version();
     // Load ITPrism library version
     if (!class_exists("Prism\\Version")) {
         $this->itprismVersion = JText::_("COM_CROWDFUNDINGFINANCE_PRISM_LIBRARY_DOWNLOAD");
     } else {
         $itprismVersion = new Prism\Version();
         $this->itprismVersion = $itprismVersion->getShortVersion();
     }
     /** @var  $cfParams Joomla\Registry\Registry */
     $cfParams = JComponentHelper::getParams("com_crowdfunding");
     $this->cfParams = $cfParams;
     // Get latest transactions.
     $this->latest = new Crowdfunding\Statistics\Transactions\Latest(JFactory::getDbo());
     $this->latest->load(5);
     $basic = new Crowdfunding\Statistics\Basic(JFactory::getDbo());
     $this->totalProjects = $basic->getTotalProjects();
     $this->totalTransactions = $basic->getTotalTransactions();
     $this->totalAmount = $basic->getTotalAmount();
     // Get currency.
     $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $this->cfParams->get("project_currency"));
     $this->amount = new Crowdfunding\Amount($this->cfParams);
     $this->amount->setCurrency($currency);
     // Add submenu
     CrowdfundingFinanceHelper::addSubmenu($this->getName());
     $this->addToolbar();
     $this->addSidebar();
     $this->setDocument();
     parent::display($tpl);
 }
 /**
  * @throws Exception
  */
 protected function prepareDocument()
 {
     $app = JFactory::getApplication();
     $menus = $app->getMenu();
     $title = null;
     // Because the application sets a default page title,
     // we need to get it from the menu item itself
     $menu = $menus->getActive();
     if ($menu) {
         $this->params->def('page_heading', $this->params->get('page_title', $this->item->title));
     } else {
         $this->params->def('page_heading', $this->item->title);
     }
     $title = $this->params->get('page_title', '');
     if (empty($title)) {
         $title = $app->get('sitename');
     } elseif ($app->get('sitename_pagetitles', 0) == 1) {
         $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
     } elseif ($app->get('sitename_pagetitles', 0) == 2) {
         $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
     }
     $this->document->setTitle($title);
     if ($this->params->get('menu-meta_description')) {
         $this->document->setDescription($this->params->get('menu-meta_description'));
     }
     if ($this->params->get('menu-meta_keywords')) {
         $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
     }
     if ($this->params->get('robots')) {
         $this->document->setMetadata('robots', $this->params->get('robots'));
     }
 }
Example #6
0
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     $txnStatesOptions = array(JHtml::_("select.option", 1, JText::_("COM_CROWDFUNDINGDATA_COMPLETED")), JHtml::_("select.option", 0, JText::_("COM_CROWDFUNDINGDATA_NOT_COMPLETED")));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_transaction_state', JHtml::_('select.options', $txnStatesOptions, 'value', 'text', $this->state->get('filter.transaction_state'), true));
     $this->sidebar = JHtmlSidebar::render();
 }
Example #7
0
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     $statesOptions = array(JHtml::_("select.option", 0, JText::_("COM_IDENTITYPROOF_NOT_VERIFIED")), JHtml::_("select.option", 1, JText::_("COM_IDENTITYPROOF_VERIFIED")));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', $statesOptions, 'value', 'text', $this->state->get('filter.state'), true));
     $this->sidebar = JHtmlSidebar::render();
 }
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->form = $this->get('Form');
     $this->importType = $this->state->get("import.context");
     switch ($this->importType) {
         case "locations":
             $this->legend = JText::_("COM_CROWDFUNDING_IMPORT_LOCATIONS_DATA");
             $this->uploadTask = "import.locations";
             break;
         case "countries":
             $this->legend = JText::_("COM_CROWDFUNDING_IMPORT_COUNTRIES_DATA");
             $this->uploadTask = "import.countries";
             break;
         case "states":
             $this->legend = JText::_("COM_CROWDFUNDING_IMPORT_STATES_DATA");
             $this->uploadTask = "import.states";
             break;
         default:
             // Currencies
             $this->legend = JText::_("COM_CROWDFUNDING_IMPORT_CURRENCY_DATA");
             $this->uploadTask = "import.currencies";
             break;
     }
     // Add submenu
     CrowdfundingHelper::addSubmenu($this->importType);
     // Prepare actions
     $this->addToolbar();
     $this->setDocument();
     parent::display($tpl);
 }
Example #9
0
 protected function prepareFundingDurationType()
 {
     $this->fundingDuration = $this->params->get("project_funding_duration");
     switch ($this->fundingDuration) {
         case "days":
             // Only days type is enabled
             $this->checkedDays = 'checked="checked"';
             break;
         case "date":
             // Only date type is enabled
             $this->checkedDate = 'checked="checked"';
             break;
         default:
             // Both ( days and date ) types are enabled
             $fundingStartDateValidator = new Prism\Validator\Date($this->item->funding_end);
             $this->checkedDays = 0;
             $this->checkedDate = "";
             if (!empty($this->item->funding_days)) {
                 $this->checkedDays = 'checked="checked"';
                 $this->checkedDate = '';
             } elseif ($fundingStartDateValidator->isValid()) {
                 $this->checkedDays = '';
                 $this->checkedDate = 'checked="checked"';
             }
             // If missing both, select days
             if (!$this->checkedDays and !$this->checkedDate) {
                 $this->checkedDays = 'checked="checked"';
             }
             break;
     }
 }
Example #10
0
 /**
  * @param int $projectId
  * @param Joomla\Registry\Registry $params
  * @param object $paymentSession
  *
  * @return stdClass
  * @throws UnexpectedValueException
  */
 public function prepareItem($projectId, $params, $paymentSession)
 {
     $project = new Crowdfunding\Project(JFactory::getDbo());
     $project->load($projectId);
     if (!$project->getId()) {
         throw new UnexpectedValueException(JText::_("COM_CROWDFUNDING_ERROR_INVALID_PROJECT"));
     }
     if ($project->isCompleted()) {
         throw new UnexpectedValueException(JText::_("COM_CROWDFUNDING_ERROR_COMPLETED_PROJECT"));
     }
     // Get currency
     $currency = Crowdfunding\Currency::getInstance(JFactory::getDbo(), $params->get("project_currency"));
     // Create amount object.
     $amount = new Crowdfunding\Amount($params);
     $amount->setCurrency($currency);
     $item = new stdClass();
     $item->id = $project->getId();
     $item->title = $project->getTitle();
     $item->slug = $project->getSlug();
     $item->catslug = $project->getCatSlug();
     $item->rewardId = $paymentSession->rewardId;
     $item->starting_date = $project->getFundingStart();
     $item->ending_date = $project->getFundingEnd();
     $item->amount = $paymentSession->amount;
     $item->currencyCode = $currency->getCode();
     $item->amountFormated = $amount->setValue($item->amount)->format();
     $item->amountCurrency = $amount->setValue($item->amount)->formatCurrency();
     return $item;
 }
Example #11
0
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     $states = array(JHtml::_("select.option", "0", JText::_("COM_SOCIALCOMMUNITY_DOES_NOT_EXISTS")), JHtml::_("select.option", "1", JText::_("COM_SOCIALCOMMUNITY_EXISTS")));
     JHtmlSidebar::addFilter(JText::_('COM_SOCIALCOMMUNITY_SELECT_PROFILE_STATE'), 'filter_profile', JHtml::_('select.options', $states, 'value', 'text', $this->state->get('filter.profile'), true));
     $this->sidebar = JHtmlSidebar::render();
 }
Example #12
0
 /**
  * Method to get an object.
  *
  * @param    integer $id The id of the object to get.
  *
  * @return    mixed    Object on success, false on failure.
  */
 public function getItem($id = null)
 {
     if (!$id) {
         $id = $this->getState($this->getName() . '.id');
     }
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select('a.id, a.title, a.description, a.votes, a.record_date, a.catid, a.user_id, a.status_id, a.hits, a.params, ' . $query->concatenate(array('a.id', 'a.alias'), '-') . ' AS slug, ' . 'b.name, b.username, ' . 'c.title AS category, ' . $query->concatenate(array('c.id', 'c.alias'), '-') . ' AS catslug, ' . 'd.name AS status_name, d.params AS status_params, d.default AS status_default');
     $query->from($db->quoteName('#__uideas_items', 'a'));
     $query->leftJoin($db->quoteName('#__users', 'b') . ' ON a.user_id = b.id');
     $query->leftJoin($db->quoteName('#__categories', 'c') . ' ON a.catid = c.id');
     $query->leftJoin($db->quoteName('#__uideas_statuses', 'd') . ' ON a.status_id = d.id');
     $query->where('a.id = ' . (int) $id);
     $db->setQuery($query);
     $this->item = $db->loadObject();
     // Prepare status object
     if ($this->item !== null and (int) $this->item->id > 0) {
         $this->prepareStatus($this->item);
         $tags = new JHelperTags();
         $this->item->tags = $tags->getItemTags('com_userideas.item', $this->item->id);
         $registry = new Joomla\Registry\Registry();
         $registry->loadString($this->item->params);
         $this->item->params = $registry;
     }
     return $this->item;
 }
Example #13
0
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     $filters = new Crowdfunding\Filters(JFactory::getDbo());
     $types = $filters->getLogTypes();
     JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDING_SELECT_TYPE'), 'filter_type', JHtml::_('select.options', $types, 'value', 'text', $this->state->get('filter.type'), true));
     $this->sidebar = JHtmlSidebar::render();
 }
 /**
  * Test the JFormRuleNotequals::test method with InvalidArgumentException
  *
  * @return void
  *
  * @covers  JFormRuleNotequals::test
  * @expectedException  InvalidArgumentException
  * @since   3.4
  */
 public function testNotequalsInvalidArgumentException()
 {
     $rule = new JFormRuleNotequals();
     $xml = simplexml_load_string('<form><field name="foo" field="notequalsfield" /></form>');
     $input = new Joomla\Registry\Registry();
     $input->set('notequalsfield', 'testvalue');
     $rule->test($xml->field, 'test');
 }
 /**
  * Prepare sortable fields, sort values and filters.
  */
 protected function prepareSorting()
 {
     $this->listOrder = $this->escape($this->state->get('list.ordering'));
     $this->listDirn = $this->escape($this->state->get('list.direction'));
     $this->saveOrder = strcmp($this->listOrder, 'a.ordering') === 0;
     $this->filterForm = $this->get('FilterForm');
     $this->activeFilters = $this->get('ActiveFilters');
 }
Example #16
0
 public function submitter()
 {
     $application = JFactory::getApplication();
     $input = $application->input;
     $name = $input->post->get("_" . md5($this->Params->get("sender0") . $application->cid . $application->mid), "", "string");
     $address = $input->post->get("_" . md5($this->Params->get("sender1") . $application->cid . $application->mid), "", "string");
     return array($address, $name);
 }
Example #17
0
 /**
  * Prepare sortable fields, sort values and filters.
  */
 protected function prepareSorting()
 {
     // Prepare filters
     $this->listOrder = $this->escape($this->state->get('list.ordering'));
     $this->listDirn = $this->escape($this->state->get('list.direction'));
     $this->saveOrder = strcmp($this->listOrder, 'a.ordering') != 0 ? false : true;
     $this->sortFields = array('a.subject' => JText::_('COM_USERIDEAS_SUBJECT'), 'a.sender_name' => JText::_('COM_USERIDEAS_SENDER_NAME'), 'a.sender_email' => JText::_('COM_USERIDEAS_SENDER_EMAIL'), 'a.id' => JText::_('JGRID_HEADING_ID'));
 }
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     // Add submenu
     SocialCommunityHelper::addSubmenu($this->getName());
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     $states = array(JHtml::_('select.option', '0', JText::_('COM_SOCIALCOMMUNITY_DOES_NOT_EXISTS')), JHtml::_('select.option', '1', JText::_('COM_SOCIALCOMMUNITY_EXISTS')));
     JHtmlSidebar::addFilter(JText::_('COM_SOCIALCOMMUNITY_SELECT_PROFILE_STATE'), 'filter_profile', JHtml::_('select.options', $states, 'value', 'text', $this->state->get('filter.profile'), true));
     $this->sidebar = JHtmlSidebar::render();
 }
Example #19
0
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array("archived" => false, "trash" => false)), 'value', 'text', $this->state->get('filter.state'), true));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category', JHtml::_('select.options', JHtml::_('category.options', 'com_userideas'), 'value', 'text', $this->state->get('filter.category'), true));
     // Item statuses
     jimport("userideas.statuses");
     $statuses = UserIdeasStatuses::getInstance(JFactory::getDbo());
     JHtmlSidebar::addFilter(JText::_('COM_USERIDEAS_SELECT_ITEM_STATUS'), 'filter_status', JHtml::_('select.options', $statuses->getStatusesOptions(), 'value', 'text', $this->state->get('filter.status'), true));
     $this->sidebar = JHtmlSidebar::render();
 }
Example #20
0
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     $this->state = $this->get('State');
     $this->item = $this->get('Item');
     $this->form = $this->get('Form');
     $this->params = $this->state->get("params");
     // Prepare actions, behaviors, scritps and document
     $this->addToolbar();
     $this->setDocument();
     parent::display($tpl);
 }
Example #21
0
 /**
  * Prepare sortable fields, sort values and filters.
  */
 protected function prepareSorting()
 {
     // Prepare filters
     $this->listOrder = $this->escape($this->state->get('list.ordering'));
     $this->listDirn = $this->escape($this->state->get('list.direction'));
     $this->saveOrder = strcmp($this->listOrder, 'a.ordering') != 0 ? false : true;
     if ($this->saveOrder) {
         $this->saveOrderingUrl = 'index.php?option=' . $this->option . '&task=' . $this->getName() . '.saveOrderAjax&format=raw';
         JHtml::_('sortablelist.sortable', $this->getName() . 'List', 'adminForm', strtolower($this->listDirn), $this->saveOrderingUrl);
     }
     $this->sortFields = array('a.title' => JText::_('COM_VIRTUALCURRENCY_TITLE'), 'a.abbr' => JText::_('COM_VIRTUALCURRENCY_ABBR'), 'a.id' => JText::_('JGRID_HEADING_ID'));
 }
 /**
  * Add a menu on the sidebar of page
  */
 protected function addSidebar()
 {
     // Prepare options
     $approvedOptions = array(JHtml::_('select.option', 1, JText::_('COM_CROWDFUNDINGFINANCE_APPROVED')), JHtml::_('select.option', 0, JText::_('COM_CROWDFUNDINGFINANCE_DISAPPROVED')));
     $featuredOptions = array(JHtml::_('select.option', 1, JText::_('COM_CROWDFUNDINGFINANCE_FEATURED')), JHtml::_('select.option', 0, JText::_('COM_CROWDFUNDINGFINANCE_NOT_FEATURED')));
     JHtmlSidebar::setAction('index.php?option=' . $this->option . '&view=' . $this->getName());
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.state'), true));
     JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDINGFINANCE_SELECT_APPROVED_STATUS'), 'filter_approved', JHtml::_('select.options', $approvedOptions, 'value', 'text', $this->state->get('filter.approved'), true));
     JHtmlSidebar::addFilter(JText::_('COM_CROWDFUNDINGFINANCE_SELECT_FEATURED_STATUS'), 'filter_featured', JHtml::_('select.options', $featuredOptions, 'value', 'text', $this->state->get('filter.featured'), true));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_CATEGORY'), 'filter_category_id', JHtml::_('select.options', JHtml::_('category.options', 'com_crowdfunding'), 'value', 'text', $this->state->get('filter.category_id')));
     $this->sidebar = JHtmlSidebar::render();
 }
 /**
  * Prepare sortable fields, sort values and filters.
  */
 protected function prepareSorting()
 {
     // Prepare filters
     $this->listOrder = $this->escape($this->state->get('list.ordering'));
     $this->listDirn = $this->escape($this->state->get('list.direction'));
     $this->saveOrder = strcmp($this->listOrder, 'a.ordering') === 0;
     if ($this->saveOrder) {
         $this->saveOrderingUrl = 'index.php?option=' . $this->option . '&task=' . $this->getName() . '.saveOrderAjax&format=raw';
         JHtml::_('sortablelist.sortable', $this->getName() . 'List', 'adminForm', strtolower($this->listDirn), $this->saveOrderingUrl);
     }
     $this->sortFields = array('a.subject' => JText::_('COM_CROWDFUNDING_SUBJECT'), 'a.email' => JText::_('COM_CROWDFUNDING_EMAIL'), 'a.record_date' => JText::_('JDATE'), 'c.name' => JText::_('COM_CROWDFUNDING_USER'), 'a.id' => JText::_('JGRID_HEADING_ID'));
 }
Example #24
0
 /**
  * Prepare sortable fields, sort values and filters.
  */
 protected function prepareSorting()
 {
     // Prepare filters
     $this->listOrder = $this->escape($this->state->get('list.ordering'));
     $this->listDirn = $this->escape($this->state->get('list.direction'));
     $this->saveOrder = strcmp($this->listOrder, 'a.ordering') != 0 ? false : true;
     if ($this->saveOrder) {
         $this->saveOrderingUrl = 'index.php?option=' . $this->option . '&task=' . $this->getName() . '.saveOrderAjax&format=raw';
         JHtml::_('sortablelist.sortable', $this->getName() . 'List', 'adminForm', strtolower($this->listDirn), $this->saveOrderingUrl);
     }
     $this->sortFields = array('a.name' => JText::_('COM_CROWDFUNDING_NAME'), 'a.registerDate' => JText::_('COM_CROWDFUNDING_REGISTRATION_DATE'), 'a.id' => JText::_('JGRID_HEADING_ID'));
 }
 /**
  * Prepare sortable fields, sort values and filters.
  */
 protected function prepareSorting()
 {
     // Prepare filters
     $this->listOrder = $this->escape($this->state->get('list.ordering'));
     $this->listDirn = $this->escape($this->state->get('list.direction'));
     $this->saveOrder = strcmp($this->listOrder, 'a.ordering') != 0 ? false : true;
     if ($this->saveOrder) {
         $this->saveOrderingUrl = 'index.php?option=' . $this->option . '&task=' . $this->getName() . '.saveOrderAjax&format=raw';
         JHtml::_('sortablelist.sortable', $this->getName() . 'List', 'adminForm', strtolower($this->listDirn), $this->saveOrderingUrl);
     }
     $this->sortFields = array('a.name' => JText::_('COM_CROWDFUNDING_NAME'), 'a.code' => JText::_('COM_CROWDFUNDING_COUNTRY_CODE'), 'a.locale' => JText::_('COM_CROWDFUNDING_COUNTRY_LOCALE'), 'a.latitude' => JText::_('COM_CROWDFUNDING_COUNTRY_LATITUDE'), 'a.longitude' => JText::_('COM_CROWDFUNDING_COUNTRY_LONGITUDE'), 'a.timezone' => JText::_('COM_CROWDFUNDING_COUNTRY_TIMEZONE'), 'a.id' => JText::_('JGRID_HEADING_ID'));
 }
Example #26
0
 /**
  * Get selected lists to add to dashboard
  * @return mixed
  */
 public static function listIcons()
 {
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select('id, label, params')->from('#__fabrik_lists')->where('params LIKE \'%"dashboard":"1"%\'');
     $db->setQuery($query);
     $lists = $db->loadObjectList();
     foreach ($lists as $list) {
         $params = new Joomla\Registry\Registry($list->params);
         $list->icon = $params->get('dashboard_icon', 'icon-list');
     }
     return $lists;
 }
Example #27
0
 /**
  * Execute and display a template script.
  *
  * @param   string $tpl The name of the template file to parse; automatically searches through the template paths.
  *
  * @throws  Exception
  *
  * @return  mixed  A string if successful, otherwise a Error object.
  *
  * @see     JViewLegacy::loadTemplate()
  * @since   1.0
  */
 public function display($tpl = null)
 {
     // Get data from the models
     $this->state = $this->get('State');
     $this->state->set('list.start', 0);
     $this->state->set('list.limit', 0);
     $this->items = $this->get('Items');
     // Check for errors
     if (count($errors = $this->get('Errors'))) {
         throw new Exception(implode("\n", $errors), 500);
     }
     $this->params = $this->state->get('params');
     parent::display($tpl);
 }
 /**
  * Method to set up the document properties
  *
  * @return void
  */
 protected function setDocument()
 {
     $this->document->setTitle($this->documentTitle);
     // Add scripts
     JHtml::_('bootstrap.tooltip');
     JHtml::_('behavior.keepalive');
     JHtml::_('behavior.formvalidation');
     $d3Cdn = (bool) $this->params->get('d3_cdn', true);
     JHtml::_('Prism.ui.d3', $d3Cdn);
     $js = '
         cfProjectId = ' . $this->item->id . ';
     ';
     $this->document->addScriptDeclaration($js);
     $this->document->addScript('../media/' . $this->option . '/js/admin/' . JString::strtolower($this->getName()) . '.js');
 }
Example #29
0
 /**
  * This method prepares a payment gateway - buttons, forms,...
  * That gateway will be displayed on the summary page as a payment option.
  *
  * @param string    $context This string gives information about that where it has been executed the trigger.
  * @param object    $item    A project data.
  * @param Joomla\Registry\Registry $params  The parameters of the component
  *
  * @return null|string
  */
 public function onPaymentExtras($context, &$item, &$params)
 {
     if (strcmp("com_crowdfunding.payment.step2", $context) != 0) {
         return null;
     }
     if ($this->app->isAdmin()) {
         return null;
     }
     $doc = JFactory::getDocument();
     /**  @var $doc JDocumentHtml */
     // Check document type
     $docType = $doc->getType();
     if (strcmp("html", $docType) != 0) {
         return null;
     }
     // Load language file of the component.
     $language = JFactory::getLanguage();
     $language->load('com_crowdfundingdata', CROWDFUNDINGDATA_PATH_COMPONENT_SITE);
     $componentParams = JComponentHelper::getParams("com_crowdfunding");
     /** @var  $componentParams Joomla\Registry\Registry */
     // Get payment session.
     $paymentSessionContext = Crowdfunding\Constants::PAYMENT_SESSION_CONTEXT . $item->id;
     $paymentSession = $this->app->getUserState($paymentSessionContext);
     if (!isset($paymentSession->step1)) {
         $path = JPath::clean(JPluginHelper::getLayoutPath('crowdfundingpayment', 'data', 'error'));
         // Render error layout.
         ob_start();
         include $path;
         return ob_get_clean();
     }
     // Get the value of therms and conditions.
     $this->terms = $paymentSession->terms;
     // Check for duplication of session ID.
     $this->prepareSessionId($item);
     // Load the form.
     JForm::addFormPath(CROWDFUNDINGDATA_PATH_COMPONENT_SITE . '/models/forms');
     JForm::addFieldPath(CROWDFUNDINGDATA_PATH_COMPONENT_SITE . '/models/fields');
     $form = JForm::getInstance('com_crowdfundingdata.record', 'record', array('control' => "jform", 'load_data' => false));
     // Prepare default name of a user.
     $user = JFactory::getUser();
     if ($user->get("id")) {
         $form->setValue("name", null, $user->get("name"));
     }
     // Set item id to the form.
     $form->setValue("project_id", null, $item->id);
     $this->form = $form;
     // Load jQuery
     JHtml::_("jquery.framework");
     // Include Chosen
     if ($this->params->get("enable_chosen", 0)) {
         JHtml::_('formbehavior.chosen', '#jform_country_id');
     }
     // Get the path for the layout file
     $path = JPath::clean(JPluginHelper::getLayoutPath('crowdfundingpayment', 'data'));
     // Render the form.
     ob_start();
     include $path;
     $html = ob_get_clean();
     return $html;
 }
Example #30
0
 /**
  * Generate links to a user avatar and profile.
  *
  * @param CrowdfundingPartners\Partners $partners
  * @param string $socialPlatform
  */
 protected function prepareIntegration($partners, $socialPlatform)
 {
     $defaultAvatar = "media/com_crowdfunding/images/no-profile.png";
     if (!empty($socialPlatform)) {
         $usersIds = array();
         foreach ($partners as $partner) {
             $usersIds[] = $partner["partner_id"];
         }
         $config = array("social_platform" => $socialPlatform, "users_ids" => $usersIds);
         $socialProfilesBuilder = new Prism\Integration\Profiles\Builder($config);
         $socialProfilesBuilder->build();
         $socialProfiles = $socialProfilesBuilder->getProfiles();
         foreach ($partners as $key => $value) {
             $value["avatar"] = $socialProfiles->getAvatar($value["partner_id"], $this->params->get("image_size", "small"));
             $value["link"] = $socialProfiles->getLink($value["partner_id"]);
             $partners[$key] = $value;
         }
     } else {
         // Set default avatar
         foreach ($partners as $key => $value) {
             $value["avatar"] = $defaultAvatar;
             $value["link"] = "";
             $partners[$key] = $value;
         }
     }
 }