Пример #1
1
 /**
  * Tries to authenticate the user and start the backup, or send him back to the default task
  */
 function authenticate()
 {
     // Enforce raw mode - I need to be in full control!
     $format = JRequest::getCmd('format', 'html');
     if ($format != 'raw') {
         $this->setRedirect(JURI::base() . 'index.php?option=com_joomlapack&view=light&format=raw');
         parent::redirect();
     } else {
         if (!$this->_checkPermissions()) {
             parent::redirect();
         } else {
             $this->_setProfile();
             jimport('joomla.utilities.date');
             jpimport('core.cube');
             JoomlapackCUBE::reset();
             $cube =& JoomlapackCUBE::getInstance();
             $user =& JFactory::getUser();
             $userTZ = $user->getParam('timezone', 0);
             $dateNow = new JDate();
             $dateNow->setOffset($userTZ);
             $cube->start(JText::_('DEFAULT_COMMENT') . ' ' . $dateNow->toFormat(JText::_('DATE_FORMAT_LC2'), ''));
             $cube->save();
             $this->setRedirect(JURI::base() . 'index.php?option=com_joomlapack&view=light&task=step&key=' . JRequest::getVar('key') . '&profile=' . JRequest::getInt('profile') . '&format=raw');
         }
     }
 }
Пример #2
0
 function loadChartData()
 {
     $db = $this->getDBO();
     $type = JRequest::getCmd('type');
     switch ($type) {
         case 'sales':
             jimport('joomla.utilities.date');
             $date = JFactory::getDate();
             $interval = JRequest::getInt('interval', '14');
             $today = $date->toFormat('%Y-%m-%d');
             $startDate = strtotime('-' . $interval . ' day', strtotime($today));
             $startDate = new JDate($startDate);
             $query = "SELECT COUNT(virtuemart_order_id) AS sales, DATE(created_on) as `date` FROM #__virtuemart_orders WHERE created_on > " . $db->Quote($startDate->toMySQL()) . " GROUP BY `date` ORDER BY `date`";
             $db->setQuery($query);
             $rows = $db->loadObjectList();
             $data = array();
             foreach ($rows as $row) {
                 $data[$row->date] = (int) $row->sales;
             }
             $today = $date->toUnix();
             for ($time = $startDate->toUnix(); $time <= $today; $time += 86400) {
                 $date = date('Y', $time) . '-' . date('m', $time) . '-' . date('d', $time);
                 if (!array_key_exists($date, $data)) {
                     $data[$date] = 0;
                 }
             }
             ksort($data);
             $startYear = $startDate->toFormat('%Y');
             $startMonth = $startDate->toFormat('%m') - 1;
             $startDay = $startDate->toFormat('%d');
             $script = "\r\n                k2martSalesChartOptions.title.text = '" . JText::_('K2MART_TOTAL_SALES', true) . "';\r\n                k2martSalesChartOptions.subtitle.text = '* " . JText::_('K2MART_CLICK_AND_DRAG_IN_THE_PLOT_AREA_TO_ZOOM_IN', true) . "';\r\n                k2martSalesChartOptions.yAxis.title.text = '" . JText::_('K2MART_SALES', true) . "';\r\n                k2martSalesChartOptions.series[0].pointStart=Date.UTC(" . $startYear . ", " . $startMonth . ", " . $startDay . "); \r\n                k2martSalesChartOptions.series[0].data=[" . implode(',', $data) . "];\r\n                ";
             break;
         case 'products':
             $limit = JRequest::getInt('limit', '20');
             $query = "SELECT product.product_sales, productData.product_name FROM #__virtuemart_products AS product \r\n                LEFT JOIN #__virtuemart_products_" . VMLANG . " AS productData ON product.virtuemart_product_id = productData.virtuemart_product_id\r\n                WHERE  product.product_sales > 0 ORDER BY product.product_sales DESC LIMIT 0, {$limit}";
             $db->setQuery($query);
             $rows = $db->loadObjectList();
             $data = array();
             $categories = array();
             foreach ($rows as $row) {
                 $data[] = (int) $row->product_sales;
                 $categories[] = "'" . $row->product_name . "'";
             }
             $script = "\r\n                k2martProductsChartOptions.title.text = '" . JText::_('K2MART_TOP_SELLING_PRODUCTS', true) . "';\r\n                k2martProductsChartOptions.yAxis.title.text = '" . JText::_('K2MART_SALES', true) . "';\r\n                k2martProductsChartOptions.xAxis.categories =[" . implode(',', $categories) . "]; \r\n                k2martProductsChartOptions.series[0].data=[" . implode(',', $data) . "];\r\n                ";
             break;
     }
     $script .= "k2martChartType = '{$type}';";
     echo $script;
 }
Пример #3
0
 static function getToday($ym = false)
 {
     jimport('joomla.utilities.date');
     $format = $ym == true ? '%Y-%m' : '%Y-%m-%d';
     $today_do = new JDate();
     return $today_do->toFormat($format);
 }
Пример #4
0
 /**
  * Tries to authenticate the user and start the backup, or send him back to the default task
  */
 public function authenticate()
 {
     // Enforce raw mode - I need to be in full control!
     $document =& JFactory::getDocument();
     $document->setType('raw');
     if (!$this->_checkPermissions()) {
         parent::redirect();
     } else {
         $session =& JFactory::getSession();
         $session->set('litemodeauthorized', 1, 'akeeba');
         $this->_setProfile();
         jimport('joomla.utilities.date');
         AECoreKettenrad::reset();
         $memory_filename = AEUtilTempvars::get_storage_filename(AKEEBA_BACKUP_ORIGIN);
         @unlink($memory_filename);
         $kettenrad =& AECoreKettenrad::load(AKEEBA_BACKUP_ORIGIN);
         $user =& JFactory::getUser();
         $userTZ = $user->getParam('timezone', 0);
         $dateNow = new JDate();
         $dateNow->setOffset($userTZ);
         if (AKEEBA_JVERSION == '16') {
             $description = JText::_('BACKUP_DEFAULT_DESCRIPTION') . ' ' . $dateNow->format(JText::_('DATE_FORMAT_LC2'), true);
         } else {
             $description = JText::_('BACKUP_DEFAULT_DESCRIPTION') . ' ' . $dateNow->toFormat(JText::_('DATE_FORMAT_LC2'));
         }
         $options = array('description' => $description, 'comment' => '');
         $kettenrad->setup($options);
         $ret = $kettenrad->tick();
         AECoreKettenrad::save(AKEEBA_BACKUP_ORIGIN);
         $this->setRedirect(JURI::base() . 'index.php?option=com_akeeba&view=light&task=step&key=' . urlencode(JRequest::getVar('key')) . '&profile=' . JRequest::getInt('profile') . '&format=raw');
     }
 }
Пример #5
0
 /**
  * Starts a backup
  * @return 
  */
 function display()
 {
     // Check permissions
     $this->_checkPermissions();
     // Set the profile
     $this->_setProfile();
     // Force the output to be of the raw format type
     JRequest::setVar('format', 'raw');
     $document =& JFactory::getDocument();
     $document->setType('raw');
     // Get the description, if present; otherwise use the default description
     jimport('joomla.utilities.date');
     $user =& JFactory::getUser();
     $userTZ = $user->getParam('timezone', 0);
     $dateNow = new JDate();
     $dateNow->setOffset($userTZ);
     $default_description = JText::_('BACKUP_DEFAULT_DESCRIPTION') . ' ' . $dateNow->toFormat(JText::_('DATE_FORMAT_LC2'));
     $description = JRequest::getString('description', $default_description);
     // Start the backup (CUBE Operation)
     jpimport('core.cube');
     JoomlapackCUBE::reset();
     $cube =& JoomlapackCUBE::getInstance();
     $cube->start($description, '');
     $cube->save();
     // Return the JSON output
     parent::display(false);
 }
 function display()
 {
     // Check permissions
     $this->_checkPermissions();
     // Set the profile
     $this->_setProfile();
     // Force the output to be of the raw format type
     JRequest::setVar('format', 'raw');
     $document =& JFactory::getDocument();
     $document->setType('raw');
     // Start the backup
     jimport('joomla.utilities.date');
     jpimport('core.cube');
     JoomlapackCUBE::reset();
     $cube =& JoomlapackCUBE::getInstance();
     $jconfig =& JFactory::getConfig();
     $userTZ = $jconfig->get('config.offset');
     /*
     $user =& JFactory::getUser();
     $userTZ = $user->getParam('timezone',0);
     */
     $dateNow = new JDate();
     $dateNow->setOffset($userTZ);
     $cube->start(JText::_('BACKUP_DEFAULT_DESCRIPTION') . ' ' . $dateNow->toFormat(JText::_('DATE_FORMAT_LC2'), ''));
     $cube->save();
     $this->setRedirect(JURI::base() . 'index.php?option=com_joomlapack&view=backup&task=step&key=' . JRequest::getVar('key') . '&profile=' . JRequest::getInt('profile', 1) . '&format=raw');
     parent::display();
 }
Пример #7
0
 function export($event)
 {
     CFactory::load('helpers', 'event');
     $handler = CEventHelper::getHandler($event);
     if (!$handler->showExport()) {
         echo JText::_('CC ACCESS FORBIDDEN');
         return;
     }
     header('Content-type: text/Calendar');
     header('Content-Disposition: attachment; filename="calendar.ics"');
     $creator = CFactory::getUser($event->creator);
     $offset = $creator->getUtcOffset();
     $date = new JDate($event->startdate);
     $dtstart = $date->toFormat('%Y%m%dT%H%M%S');
     $date = new JDate($event->enddate);
     $dtend = $date->toFormat('%Y%m%dT%H%M%S');
     $url = $handler->getFormattedLink('index.php?option=com_community&view=events&task=viewevent&eventid=' . $event->id, false, true);
     $tmpl = new CTemplate();
     $tmpl->set('dtstart', $dtstart);
     $tmpl->set('dtend', $dtend);
     $tmpl->set('url', $url);
     $tmpl->set('event', $event);
     $raw = $tmpl->fetch('events.ical');
     unset($tmpl);
     echo $raw;
     exit;
 }
Пример #8
0
 public static function formatDate($date)
 {
     if (count($date) > 0) {
         $i = 0;
         $cur_date = new JDate($date);
         $f_date = $cur_date->toFormat("%B %d, %Y");
     }
     return $f_date;
 }
Пример #9
0
 /**
  * Returns the current timestamp, taking into account any TZ information,
  * in the format specified by $format.
  * @param string $format Timestamp format string (standard PHP format string)
  * @return string
  */
 public function get_local_timestamp($format)
 {
     jimport('joomla.utilities.date');
     $jregistry = JFactory::getConfig();
     $tzDefault = $jregistry->getValue('config.offset');
     $user = JFactory::getUser();
     $tz = $user->getParam('timezone', $tzDefault);
     $dateNow = new JDate('now', $tz);
     return $dateNow->toFormat($format);
 }
Пример #10
0
	public function display()
	{
		// Check permissions
		$this->_checkPermissions();
		// Set the profile
		$this->_setProfile();

		// Start the backup
		jimport('joomla.utilities.date');
		AECoreKettenrad::reset();
		$memory_filename = AEUtilTempvars::get_storage_filename(AKEEBA_BACKUP_ORIGIN);
		@unlink($memory_filename);

		$kettenrad =& AECoreKettenrad::load(AKEEBA_BACKUP_ORIGIN);
		$user =& JFactory::getUser();
		$userTZ = $user->getParam('timezone',0);
		$dateNow = new JDate();
		$dateNow->setOffset($userTZ);
		if( AKEEBA_JVERSION == '16' ) {
			$description = JText::_('BACKUP_DEFAULT_DESCRIPTION').' '.$dateNow->format(JText::_('DATE_FORMAT_LC2'), true);
		} else {
			$description = JText::_('BACKUP_DEFAULT_DESCRIPTION').' '.$dateNow->toFormat(JText::_('DATE_FORMAT_LC2'));
		}
		$options = array(
			'description'	=> $description,
			'comment'		=> ''
		);
		$kettenrad->setup($options);
		$array = $kettenrad->tick();
		$array = $kettenrad->tick();
		AECoreKettenrad::save(AKEEBA_BACKUP_ORIGIN);
		
		if($array['Error'] != '')
		{
			// An error occured
			die('500 ERROR -- '.$array['Error']);
		}
		else
		{
			$noredirect = JRequest::getInt('noredirect', 0);
			if($noredirect != 0)
			{
				@ob_end_clean();
				echo "301 More work required";
				flush();
				JFactory::getApplication()->close();
			}
			else
			{
				$this->setRedirect(JURI::base().'index.php?option=com_akeeba&view=backup&task=step&key='.JRequest::getVar('key').'&profile='.JRequest::getInt('profile',1));
			}
		}
	}
Пример #11
0
 /**
  * Overloaded check function
  *
  * @access public
  * @return boolean
  * @see JTable::check
  * @since 1.5
  */
 function check()
 {
     if (empty($this->alias)) {
         $this->alias = $this->name;
     }
     $this->alias = JFilterOutput::stringURLSafe($this->alias);
     if (trim(str_replace('-', '', $this->alias)) == '') {
         $datenow = new JDate();
         $this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S");
     }
     return true;
 }
Пример #12
0
 /**
  * Returns the backup description
  * 
  * @param bool $noDefault Set to true to avoid setting a default
  * @return string
  */
 function getDescription($noDefault = false)
 {
     $description = JRequest::getString('description');
     if (empty($description) && !$noDefault) {
         jimport('joomla.utilities.date');
         $user =& JFactory::getUser();
         $userTZ = $user->getParam('timezone', 0);
         $dateNow = new JDate();
         $dateNow->setOffset($userTZ);
         return JText::_('BACKUP_DEFAULT_DESCRIPTION') . ' ' . $dateNow->toFormat(JText::_('DATE_FORMAT_LC2'));
     }
     return $description;
 }
Пример #13
0
 function build()
 {
     return JDom::_('html.fly.datetime', $this->options);
     //DEPRECATED : Use fly.datetime
     $formatedDate = "";
     if ($this->dataValue && $this->dataValue != "0000-00-00" && $this->dataValue != "00:00:00" && $this->dataValue != "0000-00-00 00:00:00") {
         jimport("joomla.utilities.date");
         $date = new JDate($this->dataValue);
         $formatedDate = $date->toFormat($this->dateFormat);
     }
     $this->addClass('grid-date');
     $html = '<span <%STYLE%><%CLASS%><%SELECTORS%>>' . $formatedDate . '</span>';
     return $html;
 }
Пример #14
0
 function getList(&$params)
 {
     //get database
     $db =& JFactory::getDBO();
     $query = 'SELECT MONTH( created ) AS created_month, created, id, sectionid, title, YEAR(created) AS created_year' . ' FROM #__content' . ' WHERE ( state = -1 AND checked_out = 0 )' . ' GROUP BY created_year DESC, created_month DESC';
     $db->setQuery($query, 0, intval($params->get('count')));
     $rows = $db->loadObjectList();
     $menu =& JSite::getMenu();
     $item = $menu->getItems('link', 'index.php?option=com_content&view=archive', true);
     $itemid = isset($item) ? '&Itemid=' . $item->id : '';
     $i = 0;
     $lists = array();
     foreach ($rows as $row) {
         $date = new JDate($row->created);
         $created_month = $date->toFormat("%m");
         $month_name = $date->toFormat("%B");
         $created_year = $date->toFormat("%Y");
         $lists[$i]->link = JRoute::_('index.php?option=com_content&view=archive&year=' . $created_year . '&month=' . $created_month . $itemid);
         $lists[$i]->text = $month_name . ', ' . $created_year;
         $i++;
     }
     return $lists;
 }
Пример #15
0
 /**
  * Overloaded check function
  *
  * @access public
  * @return boolean
  * @see JTable::check
  * @since 1.5
  */
 function check()
 {
     // check for valid name
     if (trim($this->title) == '') {
         $this->setError(JText::_('Your Poll must contain a title.'));
         return false;
     }
     // check for valid lag
     $this->lag = intval($this->lag);
     if ($this->lag == 0) {
         $this->setError(JText::_('Your Poll must have a non-zero lag time.'));
         return false;
     }
     if (empty($this->alias)) {
         $this->alias = $this->title;
     }
     $this->alias = JFilterOutput::stringURLSafe($this->alias);
     if (trim(str_replace('-', '', $this->alias)) == '') {
         $datenow = new JDate();
         $this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S");
     }
     return true;
 }
Пример #16
0
 function getDateRangeByViewType($date = null, $viewType = 'month')
 {
     global $now;
     $viewType = $viewType == '' ? 'month' : $viewType;
     if ($date == null) {
         $date = $now;
     } else {
         $arr = explode("/", $date);
         $date = $arr[2] . "-" . $arr[0] . "-" . $arr[1];
         $date = new JDate($date);
     }
     switch ($viewType) {
         case 'month':
             $startoffset = -($arr[1] + 5);
             $date->setOffset($startoffset * 24);
             $startdate = $date->toFormat('%Y-%m-%d');
             $endoffest = 35 - $arr[1];
             $date->setOffset($endoffest * 24);
             $enddate = $date->toFormat('%Y-%m-%d');
             break;
         case 'week':
             $startoffset = -7;
             $date->setOffset($startoffset * 24);
             $startdate = $date->toFormat('%Y-%m-%d');
             $endoffest = 7;
             $date->setOffset($endoffest * 24);
             $enddate = $date->toFormat('%Y-%m-%d');
             break;
         case 'day':
             $startoffset = -1;
             $date->setOffset($startoffset * 24);
             $startdate = $date->toFormat('%Y-%m-%d');
             $endoffest = 1;
             $date->setOffset($endoffest * 24);
             $enddate = $date->toFormat('%Y-%m-%d');
             break;
     }
     return array('startdate' => $startdate, 'enddate' => $enddate);
 }
Пример #17
0
    /**
     * Writes a list of the articles
     * @param array An array of content objects
     */
    function showList(&$rows, $page, $option, $lists)
    {
        jimport('joomla.utilities.date');
        $limitstart = JRequest::getVar('limitstart', '0', '', 'int');
        $user =& JFactory::getUser();
        $db =& JFactory::getDBO();
        $nullDate = $db->getNullDate();
        $config =& JFactory::getConfig();
        $now = new JDate();
        //Ordering allowed ?
        $ordering = $lists['order'] == 'fpordering';
        JHTML::_('behavior.tooltip');
        ?>
		<form action="index.php?option=com_frontpage" method="post" name="adminForm">

			<table>
				<tr>
					<td width="100%" class="filter">
						<?php 
        echo JText::_('Filter');
        ?>
:
						<input type="text" name="search" id="search" value="<?php 
        echo $lists['search'];
        ?>
" class="text_area" onchange="document.adminForm.submit();" />
						<button onclick="this.form.submit();"><?php 
        echo JText::_('Go');
        ?>
</button>
						<button onclick="document.getElementById('search').value=''; this.form.getElementById('filter_sectionid').value='-1'; this.form.getElementById('catid').value='0'; this.form.getElementById('filter_authorid').value='0'; this.form.getElementById('filter_state').value=''; this.form.submit();"><?php 
        echo JText::_('Reset');
        ?>
</button>
					</td>
					<td nowrap="nowrap">
						<?php 
        echo $lists['sectionid'];
        echo $lists['catid'];
        echo $lists['authorid'];
        echo $lists['state'];
        ?>
					</td>
				</tr>
			</table>

			<table class="adminlist">
			<thead>
				<tr>
					<th width="5">
						<?php 
        echo JText::_('Num');
        ?>
					</th>
					<th width="20">
						<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
					</th>
					<th class="title">
						<?php 
        echo JHTML::_('grid.sort', 'Title', 'c.title', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="10%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Published', 'c.state', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="80" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Order', 'fpordering', @$lists['order_Dir'], @$lists['order']);
        ?>
		 			</th>
					<th width="1%">
						<?php 
        echo JHTML::_('grid.order', $rows);
        ?>
					</th>
					<th width="8%" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'Access', 'groupname', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="2%" class="title" align="center" nowrap="nowrap">
						<?php 
        echo JHTML::_('grid.sort', 'ID', 'c.id', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="10%" class="title">
						<?php 
        echo JHTML::_('grid.sort', 'Section', 'sect_name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="10%" class="title">
						<?php 
        echo JHTML::_('grid.sort', 'Category', 'cc.name', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
					<th width="10%" class="title">
						<?php 
        echo JHTML::_('grid.sort', 'Author', 'author', @$lists['order_Dir'], @$lists['order']);
        ?>
					</th>
				</tr>
			</thead>
			<tfoot>
			<tr>
				<td colspan="13">
					<?php 
        echo $page->getListFooter();
        ?>
				</td>
			</tr>
			</tfoot>
			<tbody>
			<?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $link = JRoute::_('index.php?option=com_content&task=edit&cid[]=' . $row->id);
            $publish_up = new JDate($row->publish_up);
            $publish_down = new JDate($row->publish_down);
            $publish_up->setOffset($config->getValue('config.offset'));
            $publish_down->setOffset($config->getValue('config.offset'));
            if ($now->toUnix() <= $publish_up->toUnix() && $row->state == 1) {
                $img = 'publish_y.png';
                $alt = JText::_('Published');
            } else {
                if (($now->toUnix() <= $publish_down->toUnix() || $row->publish_down == $nullDate) && $row->state == 1) {
                    $img = 'publish_g.png';
                    $alt = JText::_('Published');
                } else {
                    if ($now->toUnix() > $publish_down->toUnix() && $row->state == 1) {
                        $img = 'publish_r.png';
                        $alt = JText::_('Expired');
                    } else {
                        if ($row->state == 0) {
                            $img = 'publish_x.png';
                            $alt = JText::_('Unpublished');
                        } else {
                            if ($row->state == -1) {
                                $img = 'disabled.png';
                                $alt = JText::_('Archived');
                            }
                        }
                    }
                }
            }
            $times = '';
            if (isset($row->publish_up)) {
                if ($row->publish_up == $nullDate) {
                    $times .= JText::_('Start: Always');
                } else {
                    $times .= JText::_('Start') . ": " . $publish_up->toFormat();
                }
            }
            if (isset($row->publish_down)) {
                if ($row->publish_down == $nullDate) {
                    $times .= "<br />" . JText::_('Finish: No Expiry');
                } else {
                    $times .= "<br />" . JText::_('Finish') . ": " . $publish_down->toFormat();
                }
            }
            $access = JHTML::_('grid.access', $row, $i);
            $checked = JHTML::_('grid.checkedout', $row, $i);
            if ($user->authorize('com_users', 'manage')) {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $linkA = JRoute::_('index.php?option=com_users&task=edit&cid[]=' . $row->created_by);
                    $author = '<span class="editlinktip hasTip" title="' . JText::_('Edit User') . '::' . $row->author . '">' . '<a href="' . $linkA . '">' . $row->author . '</a><span>';
                }
            } else {
                if ($row->created_by_alias) {
                    $author = $row->created_by_alias;
                } else {
                    $author = $row->author;
                }
            }
            // section handling
            if ($row->sectionid) {
                $row->sect_link = JRoute::_('index.php?option=com_sections&task=edit&cid[]=' . $row->sectionid);
                $title_sec = JText::_('Edit Section');
            }
            // category handling
            if ($row->catid) {
                $row->cat_link = JRoute::_('index.php?option=com_categories&task=edit&cid[]=' . $row->catid);
                $title_cat = JText::_('Edit Category');
            }
            ?>
				<tr class="<?php 
            echo "row{$k}";
            ?>
">
					<td>
						<?php 
            echo $page->getRowOffset($i);
            ?>
					</td>
					<td>
						<?php 
            echo $checked;
            ?>
					</td>
					<td>
						<?php 
            if (JTable::isCheckedOut($user->get('id'), $row->checked_out)) {
                echo $row->title;
            } else {
                ?>
							<span class="editlinktip hasTip" title="<?php 
                echo JText::_('Edit Content');
                ?>
::<?php 
                echo $row->name;
                ?>
">
							<a href="<?php 
                echo $link;
                ?>
">
								<?php 
                echo $row->title;
                ?>
</a></span>
							<?php 
            }
            ?>
					</td>
					<?php 
            if ($times) {
                ?>
						<td align="center">
							<span class="editlinktip hasTip" title="<?php 
                echo JText::_('Publish Information');
                ?>
::<?php 
                echo $times;
                ?>
">
							<a href="javascript:void(0);" onclick="return listItemTask('cb<?php 
                echo $i;
                ?>
','<?php 
                echo $row->state ? 'unpublish' : 'publish';
                ?>
')">
								<img src="images/<?php 
                echo $img;
                ?>
" width="16" height="16" border="0" alt="<?php 
                echo $alt;
                ?>
" /></a></span>
						</td>
						<?php 
            }
            ?>
					<td class="order" colspan="2">
						<span><?php 
            echo $page->orderUpIcon($i, true, 'orderup', 'Move Up', $ordering);
            ?>
</span>
						<span><?php 
            echo $page->orderDownIcon($i, $n, true, 'orderdown', 'Move Down', $ordering);
            ?>
</span>
						<?php 
            $disabled = $ordering ? '' : 'disabled="disabled"';
            ?>
						<input type="text" name="order[]" size="5" value="<?php 
            echo $row->fpordering;
            ?>
" <?php 
            echo $disabled;
            ?>
 class="text_area" style="text-align: center" />
					</td>
					<td align="center">
						<?php 
            echo $access;
            ?>
					</td>
					<td align="center">
						<?php 
            echo $row->id;
            ?>
					</td>
					<td>
						<?php 
            if ($row->sectionid) {
                ?>
						<span class="editlinktip hasTip" title="<?php 
                echo $title_sec;
                ?>
::<?php 
                echo $row->sect_name;
                ?>
">
							<a href="<?php 
                echo $row->sect_link;
                ?>
">
								<?php 
                echo $row->sect_name;
                ?>
</a></span>
						<?php 
            }
            ?>
					</td>
					<td>
						<?php 
            if ($row->catid) {
                ?>
						<span class="editlinktip hasTip" title="<?php 
                echo $title_cat;
                ?>
::<?php 
                echo $row->name;
                ?>
">
							<a href="<?php 
                echo $row->cat_link;
                ?>
" title="<?php 
                echo $title_cat;
                ?>
">
								<?php 
                echo $row->name;
                ?>
</a></span>
						<?php 
            }
            ?>
					</td>
					<td>
						<?php 
            echo $author;
            ?>
					</td>
				</tr>
				<?php 
            $k = 1 - $k;
        }
        ?>
			</tbody>
			</table>
			<?php 
        JHTML::_('content.legend');
        ?>

		<input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
		<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
		<?php 
        echo JHTML::_('form.token');
        ?>
		</form>
		<?php 
    }
Пример #18
0
</table>
</div>
</div>
</div>
</div>
<div id="at-footerwrap">
<div id="at-footer">
<?php 
defined('_JEXEC') or die('Restricted access');
global $_VERSION;
require_once 'libraries/joomla/utilities/date.php';
$date = new JDate();
$config = new JConfig();
?>
Copyright &copy; <?php 
echo $date->toFormat('%Y') . ' ' . $config->sitename;
?>
. Designed by <a href="http://www.pickjoomla.com/" title="Visit pickjoomla.com!" target="blank">pickjoomla</a>
<div id= "goup-image">
<a href="#up" title="Go up" style="text-decoration: none;"><img src="<?php 
echo $this->baseurl;
?>
/templates/<?php 
echo $this->template;
?>
/images/go-up.gif" title="Go up" alt="Go up" /></a>
</div>
</div>
</div>
</div>
</body>
Пример #19
0
    if (!$item->lastvisit_xml) {
        $xmlDate = JText::_('Date_Never');
    } elseif ($item->lastvisit_xml > $now - 3600) {
        // Less than one hour
        $xmlDate = JText::sprintf('Date_Minutes_Ago', intval(($now - $item->lastvisit_xml) / 60));
    } elseif ($item->lastvisit_xml > $now - 86400) {
        // Less than one day
        $hours = intval(($now - $item->lastvisit_xml) / 3600);
        $xmlDate = JText::sprintf('Date_Hours_Minutes_Ago', $hours, ($now - $hours * 3600 - $item->lastvisit_xml) / 60);
    } elseif ($item->lastvisit_xml > $now - 259200) {
        // Less than three days
        $days = intval(($now - $item->lastvisit_xml) / 86400);
        $xmlDate = JText::sprintf('Date_Days_Hours_Ago', $days, intval(($now - $days * 86400 - $item->lastvisit_xml) / 3600));
    } else {
        $date = new JDate($item->lastvisit_xml);
        $xmlDate = $date->toFormat('%Y-%m-%d %H:%M');
    }
    ?>
			<tr class="row<?php 
    echo $i % 2;
    ?>
">
				<td class="center">
					<?php 
    echo JHtml::_('grid.id', $i, $item->id);
    ?>
				</td>
				<td>
					<a href="<?php 
    echo JRoute::_('index.php?option=com_xmap&task=sitemap.edit&id=' . $item->id);
    ?>
 function matches_output($month, $year)
 {
     global $mainframe;
     $language = JFactory::getLanguage();
     //get the current language
     $language->load('mod_joomleague_calendar');
     //load the language ini file of the module
     $article = $language->_('MOD_JOOMLEAGUE_CALENDAR_VALUEMATCH');
     $articles = $language->_('MOD_JOOMLEAGUE_CALENDAR_VALUEMATCHES');
     //this strings are used for the titles of the links
     $article2 = $language->_('MOD_JOOMLEAGUE_CALENDAR_MATCHTHISDAY');
     $noarticle = $language->_('MOD_JOOMLEAGUE_CALENDAR_NOMATCHES');
     $outstring = '';
     $todaystring = '';
     $matches = $this->matches;
     $div = '';
     $now = new JDate();
     $today = $now->toFormat('%Y-%m-%d');
     $todaytitle = '';
     $pm = '';
     $offset = 0;
     // $mainframe->getCfg('offset');
     $update_module = $this->params->get('update_module', 0);
     $totalgamesstring = count($matches) > 0 ? count($matches) : $noarticle;
     $totalgamesstring .= ' ';
     $totalgamesstring .= count($matches) > 1 ? $articles : $article;
     $totalgamesstring .= ' ';
     $totalgamesstring .= $language->_('MOD_JOOMLEAGUE_CALENDAR_VALUEMATCHESMONTH') . ' ' . $this->monthNames[$month - 1] . ' ' . $year;
     $thistitle = $todaytitle != '' ? $todaytitle : $totalgamesstring;
     $thistitle = $totalgamesstring;
     $format = array();
     $format[] = array('tag' => 'span', 'divid' => 'oldjlCalListTitle-' . $this->modid, 'class' => 'jlcal_hiddenmatches', 'text' => $totalgamesstring);
     $format[] = array('tag' => 'span', 'divid' => 'jlCalListTitle-' . $this->modid, 'class' => 'jlCalListTitle', 'text' => $thistitle);
     $format[] = array('tag' => 'span', 'divid' => 'jlCalListDayTitle-' . $this->modid, 'class' => 'jlCalListTitle', 'text' => '');
     for ($x = 0; $x < count($matches); $x++) {
         $sclass = $x % 2 ? 'sectiontableentry1' : 'sectiontableentry2';
         $row = $matches[$x];
         $thispm = $row['project_id'] . '_' . $row['matchcode'] . '_' . $row['type'];
         $da = new JDate($row['date'], -$offset);
         if ($div != $da->toFormat('%Y-%m-%d')) {
             $counter = 0;
             $div = $da->toFormat('%Y-%m-%d');
             $format[] = array('tag' => 'div', 'divid' => 'jlcal_' . $div . "-" . $this->modid, 'class' => 'jlcal_hiddenmatches');
             $format[] = array('tag' => 'table', 'divid' => 'jlcal_' . $div . "-" . $this->modid, 'class' => 'jlcal_result_table');
         }
         if ($pm != $thispm) {
             $format[] = array('tag' => 'headingrow', 'text' => $row['headingtitle']);
             $roundname = $row['headingtitle'];
         }
         $pm = $thispm;
         $format[] = $row;
         $counter++;
         if (isset($matches[$x + 1])) {
             $nd = new JDate($matches[$x + 1]['date'], -$offset);
         } else {
             $nd = false;
         }
         if (!$nd || $nd->toFormat('%Y-%m-%d') != $da->toFormat('%Y-%m-%d')) {
             $pm = '';
             $format[] = array('tag' => 'tableend');
             $format[] = array('tag' => 'divend');
             $titletext = $counter;
             $titletext .= ' ';
             $titletext .= $counter > 1 ? $articles : $article;
             $titletext .= ' ';
             $titletext .= $today == $da->toFormat('%Y-%m-%d') ? $language->_('MOD_JOOMLEAGUE_CALENDAR_TODAY') : $language->_('MOD_JOOMLEAGUE_CALENDAR_AT');
             $titletext .= ' ' . $da->toFormat('%d') . '. ' . $this->monthNames[$month - 1] . ' ' . $year;
             $format[] = array('tag' => 'span', 'divid' => 'jlcaltitte_' . $div . "-" . $this->modid, 'class' => 'jlcal_hiddenmatches', 'text' => $titletext);
         }
     }
     return $format;
 }
Пример #21
0
        ?>
 fright">
                    <ul>
                        <li class="lstsumm SummaryRow"><?php 
        if ($order == 'date') {
            echo '<span class="' . $sortimage . '">&nbsp;</span>';
        }
        $date = new JDate($row->post_date);
        ?>
<b><?php 
        echo JText::_('POSTED_ON');
        ?>
    				   		  <?php 
        switch ($this->config->long_date_format) {
            case 0:
                echo ' ' . $date->toFormat("%d %b, %Y");
                break;
            case 1:
                echo ' ' . $date->toFormat("%b %d, %Y");
                break;
            case 2:
                echo ' ' . $date->toFormat("%Y, %b %d");
                break;
                ?>
    			       	      <?php 
        }
        ?>
                        	</b>
                        </li>
                        <li class="lstsumm SummaryRow"><?php 
        echo strlen($row->salary) < 1 ? JText::_('SALARY_NEGOTIABLE') : $row->salary;
Пример #22
0
 /**
  * Overloaded check function
  *
  * @access public
  * @return boolean
  * @see JTable::check
  * @since 1.5
  */
 function check()
 {
     $this->default_con = intval($this->default_con);
     if (JFilterInput::checkAttribute(array('href', $this->webpage))) {
         $this->setError(JText::_('Please provide a valid URL'));
         return false;
     }
     // check for http on webpage
     if (strlen($this->webpage) > 0 && !(eregi('http://', $this->webpage) || eregi('https://', $this->webpage) || eregi('ftp://', $this->webpage))) {
         $this->webpage = 'http://' . $this->webpage;
     }
     if (empty($this->alias)) {
         $this->alias = $this->name;
     }
     $this->alias = JFilterOutput::stringURLSafe($this->alias);
     if (trim(str_replace('-', '', $this->alias)) == '') {
         $datenow = new JDate();
         $this->alias = $datenow->toFormat("%Y-%m-%d-%H-%M-%S");
     }
     return true;
 }
Пример #23
0
    function showLoggedInMembers($option, &$rows)
    {
        global $mainframe;
        jimport('joomla.utilities.date');
        $date = new JDate('now');
        $tzoffset = $mainframe->getCfg('offset');
        $date->setOffset($tzoffset);
        $timeStr = $date->toFormat("%l:%M %P");
        $dateStr = $date->toFormat("%A, %B %e, %G");
        //$tzEST = new DateTimeZone('America/New_York');
        //$date = new DateTime("now", $tzEST);
        //$date = new DateTime("now");
        //$timeStr = $date->format("g:i a");
        //$dateStr = $date->format("l, F jS Y");
        ?>
  <h2>There are currently <?php 
        print count($rows);
        ?>
 members clocked in at <?php 
        print "{$timeStr} on {$dateStr}";
        ?>
</h2>
  <form action="index.php" method="post" name="adminForm" id="adminForm">
  <input type="hidden" name="option" value="<?php 
        echo $option;
        ?>
" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="task" value="" />
Clock out time:
		<?php 
        echo "<select name=\"hour\">";
        for ($q = 1; $q < 24; $q++) {
            echo "<option ";
            if ($q == 21) {
                echo "selected ";
            }
            echo "value=\"" . $q . "\">" . $q;
        }
        echo "</select><select name=\"minute\"><option value=\"0\">00</option>";
        for ($q = 1; $q < 4; $q++) {
            echo "<option value=\"" . 15 * $q . "\">" . 15 * $q . "</option>";
        }
        ?>
	</select><br>
  <table class="adminlist">
    <thead>
      <tr>
        <th width="20px">
          <input type="checkbox" name="toggle" 
               value="" onclick="checkAll(<?php 
        echo count($rows);
        ?>
);" />
        </th>
        <th width="50%">Name</th>
        <th width="15%">Email</th>
        <th width="10%">Emergency Phone</th>
	<th width="10%">Time in</th>
	<th width="10%">For</th>
        <th width="5%">Member?</th>
      </tr>
    </thead>

    <?php 
        $k = 0;
        for ($i = 0, $n = count($rows); $i < $n; $i++) {
            $row =& $rows[$i];
            $checked = JHTML::_('grid.id', $i, $row->transid);
            $link = JFilterOutput::ampReplace('index.php?option=' . $option . '&task=edit&cid[]=' . $row->id);
            ?>
      <tr class="<?php 
            echo "row{$k}";
            ?>
">
        <td>
          <?php 
            echo $checked;
            ?>
        </td>
        <td>
          <a href="<?php 
            echo $link;
            ?>
"><?php 
            echo $row->nameFirst . ' ' . $row->nameLast;
            ?>
</a>
        </td>
        <td>
          <?php 
            echo $row->emailAddress;
            ?>
        </td>
        <td>
          <?php 
            echo $row->phoneEmerg;
            ?>
        </td>
        <td>
          <?php 
            echo $row->dateOpen;
            ?>
        </td>
        <td>
        </td>
        <td align="center">
          <?php 
            echo $row->isMember ? JHTML::image('administrator/images/tick.png', 'yes') : JHTML::image('administrator/images/publish_x.png', 'yes');
            ?>
 
        </td>
      </tr>
      <?php 
            $k = 1 - $k;
        }
        ?>
  </table>
  </form>
  <?php 
    }
Пример #24
0
 /**
  * Save a connection
  */
 function save()
 {
     // Check for request forgeries
     JRequest::checkToken() or die('Invalid Token');
     jimport('joomla.utilities.date');
     $session =& JFactory::getSession();
     $user =& JFactory::getUser();
     $db =& JFactory::getDBO();
     $pluginManager =& JModel::getInstance('Pluginmanager', 'FabrikModel');
     $task = JRequest::getCmd('task');
     $id = JRequest::getInt('id', 0, 'post');
     $details = JRequest::getVar('details', array(), 'post', 'array');
     $className = $details['plugin'];
     $elementModel = $pluginManager->getPlugIn($className, 'element');
     $elementModel->setId($id);
     $row =& $elementModel->getElement();
     $origRow = clone $row;
     $this->_setSaveRedirect($task, $row->id);
     $name = JRequest::getVar('name', '', 'post', 'CMD');
     $name = str_replace('-', '_', $name);
     if (FabrikWorker::isReserved($name)) {
         return JError::raiseWarning(500, JText::_('SORRY THIS NAME IS RESERVED FOR FABRIK'));
     }
     if (JRequest::getInt('id') === 0) {
         //have to forcefully set group id otherwise tablemodel id is blank
         $elementModel->getElement()->group_id = $details['group_id'];
     }
     $tableModel =& $elementModel->getTableModel();
     //are we updating the name of the primary key element?
     if ($row->name === str_replace('`', '', $tableModel->_shortKey())) {
         if ($name !== $row->name) {
             //yes we are so update the table
             $table =& $tableModel->getTable();
             $table->db_primary_key = str_replace($row->name, $name, $table->db_primary_key);
             $table->store();
         }
     }
     //test for duplicate names
     //unlinking produces this error
     if (!JRequest::getVar('unlink', false)) {
         $row->group_id = (int) $details['group_id'];
         $db->setQuery("SELECT t.id, group_id FROM `#__fabrik_joins` AS j " . "\n LEFT JOIN #__fabrik_tables AS t " . "\n ON j.table_join = t.db_table_name " . "\n WHERE group_id = " . (int) $row->group_id . " AND element_id = 0");
         $res = $db->loadObject();
         if (is_null($res)) {
             // no join found
             if ($tableModel->fieldExists(JRequest::getVar('name'), array($id))) {
                 return JError::raiseWarning(500, JText::_('SORRY THIS NAME IS ALREADY IN USE'));
             }
         } else {
             $jointableModel =& JModel::getInstance('table', 'fabrikModel');
             $jointableModel->setId((int) $res->id);
             $joinEls = $jointableModel->getElements();
             $ignore = array($id);
             foreach ($joinEls as $joinEl) {
                 if ($joinEl->getElement()->name == JRequest::getVar('name')) {
                     $ignore[] = $joinEl->getElement()->id;
                 }
             }
             if ($jointableModel->fieldExists(JRequest::getVar('name'), $ignore)) {
                 JError::raiseNotice(500, JText::_('SORRY THIS NAME IS ALREADY IN USE'));
             }
         }
     }
     //end  duplicate name test
     $post = JRequest::get('post', 4);
     // $$$ hugh allows "safe" HTML.
     //$$$ rob default etc may require you to have \" or < recored - safe html filter removes these
     $raws = array('default', 'sub_values');
     foreach ($raws as $raw) {
         $post[$raw] = JRequest::getVar($raw, null, 'default', 'none', 2);
     }
     $tableParams =& $tableModel->getParams();
     //only update the element name if we can alter existing columns, otherwise the name and
     //field name become out of sync
     //if ($tableParams->get('alter_existing_db_cols') == 1 || $id == 0) {
     // $$$ hugh - check to see if there's actually a table
     if (empty($tableModel->_id) || ($tableModel->_canAlterFields() || $id == 0)) {
         $post['name'] = $name;
     } else {
         $post['name'] = JRequest::getVar('name_orig', '', 'post', 'cmd');
     }
     $ar = array('state', 'use_in_page_title', 'show_in_table_summary', 'link_to_detail', 'can_order', 'filter_exact_match');
     foreach ($ar as $a) {
         if (!array_key_exists($a, $post)) {
             $post[$a] = 0;
         }
     }
     // $$$ rob - test for change in element type
     //(eg if changing from db join to field we need to remove the join
     //entry from the #__fabrik_joins table
     $origElementModel =& JModel::getInstance('Element', 'FabrikModel');
     $origElementModel->setId($id);
     $origEl =& $origElementModel->getElement();
     $origElementPluginModel =& $pluginManager->getPlugIn($origEl->plugin, 'element');
     $origElementPluginModel->beforeSave($row);
     if (!$row->bind($post)) {
         return JError::raiseWarning(500, $row->getError());
     }
     //unlink linked elements
     if (JRequest::getVar('unlink') == 'on') {
         $row->parent_id = 0;
     }
     //merge details params into element table fields
     if (!array_key_exists('eval', $details)) {
         $details['eval'] = 0;
     }
     if (!array_key_exists('hidden', $details)) {
         $details['hidden'] = 0;
     }
     $row->bind($details);
     $datenow = new JDate();
     if ($row->id != 0) {
         $row->modified = $datenow->toFormat();
         $row->modified_by = $user->get('id');
     } else {
         $row->created = $datenow->toFormat();
         $row->created_by = $user->get('id');
         $row->created_by_alias = $user->get('username');
     }
     // 	save params
     $params = $elementModel->getParams();
     $row->attribs = $params->updateAttribsFromParams(JRequest::getVar('params', array(), 'post', 'array'));
     $cond = 'group_id = ' . (int) $row->group_id;
     //hack for width option
     if ($row->width == '') {
         $row->width = 40;
     }
     $new = $row->id == 0 ? true : false;
     if ($new) {
         $row->ordering = $row->getNextOrder($cond);
     }
     if (!$row->store()) {
         return JError::raiseWarning(500, $row->getError());
     }
     $row->checkin();
     $row->reorder($cond);
     $elementModel->setId($row->id);
     $oldParams = $elementModel->_params;
     //unset and reload the params with newly saved values
     unset($elementModel->_params);
     $elementModel->getParams();
     $elementModel->updateJavascript();
     if (!$elementModel->onSave()) {
         //revert row back to original data
         foreach ($origRow as $k => $v) {
             $row->{$k} = $v;
             $row->store();
         }
         $this->setRedirect('index.php?option=com_fabrik&c=element&task=edit&cid[]=' . $row->id);
         return;
     }
     //set flags in session to ensure we de/encrypt columns data when the field's structure is updated
     $session->clear('com_fabrik.admin.element.encryptCol');
     $session->clear('com_fabrik.admin.element.decryptCol');
     $encryptCol = $oldParams->get('encrypt') == 0 && $elementModel->getParams()->get('encrypt') == 1;
     $session->set('com_fabrik.admin.element.encryptCol', $encryptCol);
     $decryptCol = $oldParams->get('encrypt') == 1 && $elementModel->getParams()->get('encrypt') == 0;
     $session->set('com_fabrik.admin.element.decryptCol', $decryptCol);
     $this->updateChildIds($row);
     $this->setMessage(JText::_('ELEMENT SAVED'));
     $origName = JRequest::getVar('name_orig', '', 'post', 'cmd');
     list($update, $q, $oldName, $newdesc, $origDesc, $dropIndex) = $tableModel->shouldUpdateElement($elementModel, $origName);
     // If new, check if the element's db table is used by other tables and if so add the element
     // to each of those tables' groups
     if ($new) {
         $this->addElementToOtherDbTables($elementModel, $row);
     }
     $elementModel->createRepeatElement();
     if ($update) {
         $origplugin = JRequest::getVar('plugin_orig');
         $session->set('com_fabrik.admin.element.updatequery', $q);
         $session->set('com_fabrik.admin.element.oldname', $oldName);
         $session->set('com_fabrik.admin.element.newdesc', $newdesc);
         $session->set('com_fabrik.admin.element.origdesc', $origDesc);
         $session->set('com_fabrik.admin.element.newname', $name);
         $session->set('com_fabrik.admin.element.dropindex', $dropIndex);
         $this->setRedirect('index.php?option=com_fabrik&c=element&task=confirmElementUpdate&id=' . (int) $row->id . "&origplugin={$origplugin}&&origtaks={$task}&plugin={$row->plugin}");
     } else {
         $this->_setSaveRedirect($task, $row->id);
     }
     $cache =& JFactory::getCache('com_fabrik');
     $cache->clean();
     if ((int) $tableModel->getTable()->id !== 0) {
         $this->updateIndexes($elementModel, $tableModel, $row);
     }
     // $$$ hugh - adding afterSave(), for things like join element to handle adding
     // rows to joins table for any children we created (can't use onSave 'cos children
     // haven't been create at that point).
     $elementModel->onAfterSave($row);
     //used for prefab
     return $elementModel;
 }
Пример #25
0
	$startTime->setOffset($userTZ);

	$filename_col = '';

	if(empty($record['description'])) $record['description'] = JText::_('STATS_LABEL_NODESCRIPTION');
	?>
		<tr class="row<?php echo $id; ?>">
			<td><?php echo $check; ?></td>
			<td>
				<?php echo $this->escape($record['description']) ?>
			</td>
			<td>
				<?php if( AKEEBA_JVERSION == '16' ): ?>
					<?php echo $startTime->format(JText::_('DATE_FORMAT_LC2'), true); ?>
				<?php else: ?>
					<?php echo $startTime->toFormat(JText::_('DATE_FORMAT_LC2')); ?>
				<?php endif; ?>
			</td>
			<td class="bufa-<?php echo $record['meta']; ?>"><?php echo $status ?></td>
			<td><?php echo ($record['meta'] == 'ok') ? format_filesize($record['size']) : ($record['total_size'] > 0 ? "(<i>".format_filesize($record['total_size'])."</i>)" : '&mdash;') ?></td>
			<td>
				<?php echo $filename_col; ?>
				<?php if($record['meta'] == 'ok'): ?>
					<br/>
					<?php
						$infoParts = explode("\n", $record['comment']);
						$info = json_decode($infoParts[1]);
					?>
					<?php echo JText::_($info->type) .': '. $info->name ?>
					<?php if($info->version): ?>
					&bull;
Пример #26
0
       ?>
            </div>
 	       <?php 
       if ($this->data->expiry_date != "0000-00-00 00:00:00") {
           ?>
 		       <div class="jsrow lrow">
 		   		  <?php 
           $exp_date = new JDate($this->data->expiry_date);
           ?>
 		          	<?php 
           echo '<span class="summtitle">' . JText::_('APPLY_BEFORE') . ':</span><br /><b>';
           ?>
 			   		  <?php 
           switch ($this->config->long_date_format) {
               case 0:
                   echo $exp_date->toFormat("%d %b, %Y") . '</b>';
                   break;
               case 1:
                   echo $exp_date->toFormat("%b %d, %Y") . '</b>';
                   break;
               case 2:
                   echo $exp_date->toFormat("%Y, %b %d") . '</b>';
                   break;
                   ?>
 		       	  <?php 
           }
           ?>
 		       </div>
 	       <?php 
       }
       ?>
Пример #27
0
 function loadBlogByDate($bdate = null)
 {
     if (!$bdate) {
         $dateNow = new JDate();
         $bdate = $dateNow->toFormat('%Y-%m-%d');
     }
     $db =& JFactory::getDBO();
     $where = array();
     $where[] = ' (published > 0)';
     $where[] = ' ( date(bdate) =' . $db->Quote($db->getEscaped($bdate, true), false) . ')';
     $where = count($where) ? ' WHERE ' . implode(' AND ', $where) : '';
     $query = "select * from #__blog_blogs " . $where;
     $result = $this->_getList($query);
     return $result;
 }
Пример #28
0
	<br />
	<!-- Pagina di riassunto delle recensioni  -->
	<?php 
/* recupero i dati dell'ordine se viene passato*/
$showForm = true;
$name = $user->name;
$email = $user->email;
$ratingError = 0;
$merchantId = $this->item->MerchantId;
$jdate = new JDate('now');
// 3:20 PM, December 1st, 2012
$endjdate = new JDate('now -1 year');
// 3:20 PM, December 1st, 2012
$listDateArray = array();
while ($jdate > $endjdate) {
    $listDateArray[$jdate->format('Ym01')] = $jdate->toFormat('%B %Y');
    $jdate->modify('-1 month');
}
$selectdate = true;
if (!empty($hashorder)) {
    //	 controllo se ho un ordine
    $orderid = BFCHelper::decrypt($hashorder);
    //	controllo se è un ordine numerico
    if (is_numeric($orderid)) {
        //		controllo se esiste già una recensione per quell'ordine altrimenti no la faccio vedere
        $ratingCount = BFCHelper::getTotalRatingsByOrderId($orderid);
        if ($ratingCount > 0) {
            //ordine con già una recensione
            $ratingError = 2;
            $showForm = false;
        } else {
Пример #29
0
 function onUserAfterSave($data, $isNew, $result, $error)
 {
     $userId = JArrayHelper::getValue($data, 'id', 0, 'int');
     if ($userId && $result && isset($data['profile']) && count($data['profile'])) {
         try {
             //Sanitize the date
             if (!empty($data['profile']['dob'])) {
                 $date = new JDate($data['profile']['dob']);
                 $data['profile']['dob'] = $date->toFormat('%Y-%m-%d');
             }
             $db = JFactory::getDbo();
             $db->setQuery('DELETE FROM #__user_profiles WHERE user_id = ' . $userId . " AND profile_key LIKE 'profile.%'");
             if (!$db->query()) {
                 throw new Exception($db->getErrorMsg());
             }
             $tuples = array();
             $order = 1;
             foreach ($data['profile'] as $k => $v) {
                 $tuples[] = '(' . $userId . ', ' . $db->quote('profile.' . $k) . ', ' . $db->quote($v) . ', ' . $order++ . ')';
             }
             $db->setQuery('INSERT INTO #__user_profiles VALUES ' . implode(', ', $tuples));
             if (!$db->query()) {
                 throw new Exception($db->getErrorMsg());
             }
         } catch (JException $e) {
             $this->_subject->setError($e->getMessage());
             return false;
         }
     }
     return true;
 }
Пример #30
0
 /**
  * AJAX method to add predefined activity
  **/
 public function ajaxAddPredefined($key, $message = '')
 {
     $objResponse = new JAXResponse();
     $my = CFactory::getUser();
     $filter = JFilterInput::getInstance();
     $key = $filter->clean($key, 'string');
     $message = $filter->clean($message, 'string');
     CFactory::load('libraries', 'activities');
     CFactory::load('helpers', 'owner');
     if (!COwnerHelper::isCommunityAdmin()) {
         return;
     }
     // Predefined system custom activity.
     $system = array('system.registered', 'system.populargroup', 'system.totalphotos', 'system.popularprofiles', 'system.popularphotos', 'system.popularvideos');
     $act = new stdClass();
     $act->actor = $my->id;
     $act->target = 0;
     $act->app = 'system';
     $act->access = PRIVACY_FORCE_PUBLIC;
     $params = new CParameter('');
     if (in_array($key, $system)) {
         switch ($key) {
             case 'system.registered':
                 CFactory::load('helpers', 'time');
                 $usersModel = CFactory::getModel('user');
                 $now = new JDate();
                 $date = CTimeHelper::getDate();
                 $title = JText::sprintf('COM_COMMUNITY_TOTAL_USERS_REGISTERED_THIS_MONTH_ACTIVITY_TITLE', $usersModel->getTotalRegisteredByMonth($now->toFormat('%Y-%m')), $date->_monthToString($now->toFormat('%m')));
                 $act->cmd = 'system.registered';
                 $act->title = $title;
                 $act->content = '';
                 break;
             case 'system.populargroup':
                 $groupsModel = CFactory::getModel('groups');
                 $activeGroup = $groupsModel->getMostActiveGroup();
                 $title = JText::sprintf('COM_COMMUNITY_MOST_POPULAR_GROUP_ACTIVITY_TITLE', $activeGroup->name);
                 $params->set('action', 'groups.join');
                 $params->set('group_url', CRoute::_('index.php?option=com_community&view=groups&task=viewgroup&groupid=' . $activeGroup->id));
                 $act->cmd = 'groups.popular';
                 $act->cid = $activeGroup->id;
                 $act->title = $title;
                 break;
             case 'system.totalphotos':
                 $photosModel = CFactory::getModel('photos');
                 $total = $photosModel->getTotalSitePhotos();
                 $params->set('photos_url', CRoute::_('index.php?option=com_community&view=photos'));
                 $act->cmd = 'photos.total';
                 $act->title = JText::sprintf('COM_COMMUNITY_TOTAL_PHOTOS_ACTIVITY_TITLE', $total);
                 break;
             case 'system.popularprofiles':
                 CFactory::load('libraries', 'tooltip');
                 $act->cmd = 'members.popular';
                 $act->title = JText::sprintf('COM_COMMUNITY_ACTIVITIES_TOP_PROFILES', 5);
                 $params->set('action', 'top_users');
                 $params->set('count', 5);
                 break;
             case 'system.popularphotos':
                 $act->cmd = 'photos.popular';
                 $act->title = JText::sprintf('COM_COMMUNITY_ACTIVITIES_TOP_PHOTOS', 5);
                 $params->set('action', 'top_photos');
                 $params->set('count', 5);
                 break;
             case 'system.popularvideos':
                 $act->cmd = 'videos.popular';
                 $act->title = JText::sprintf('COM_COMMUNITY_ACTIVITIES_TOP_VIDEOS', 5);
                 $params->set('action', 'top_videos');
                 $params->set('count', 5);
                 break;
         }
     } else {
         // For additional custom activities, we only take the content passed by them.
         if (!empty($message)) {
             CFactory::load('helpers', 'string');
             $message = CStringHelper::escape($message);
             $app = explode('.', $key);
             $app = isset($app[0]) ? $app[0] : 'system';
             $act->title = JText::_($message);
             $act->app = $app;
         }
     }
     $this->cacheClean(array(COMMUNITY_CACHE_TAG_ACTIVITIES));
     // Allow comments on all these
     $act->comment_id = CActivities::COMMENT_SELF;
     $act->comment_type = $key;
     // Allow like for all admin activities
     $act->like_id = CActivities::LIKE_SELF;
     $act->like_type = $key;
     // Add activity logging
     CActivityStream::add($act, $params->toString());
     $objResponse->addAssign('activity-stream-container', 'innerHTML', $this->_getActivityStream());
     $objResponse->addScriptCall("joms.jQuery('.jomTipsJax').addClass('jomTips');");
     $objResponse->addScriptCall('joms.tooltip.setup();');
     return $objResponse->sendResponse();
 }