Esempio n. 1
0
 function list_all($name, $category_id, $selected_categories = array(), $size = 1, $toplevel = true, $multiple = false)
 {
     $db = JFactory::getDBO();
     $q = "SELECT parent_id FROM #__guru_categoryrel ";
     if ($category_id) {
         $q .= "WHERE child_id ='{$category_id}'";
     }
     $db->setQuery($q);
     $db->query();
     $category_id = $db->loadResult();
     if (isset($_POST['parentcategory_id'])) {
         $category_id = intval($_POST['parentcategory_id']);
     }
     $pid = JREquest::getVar("pid", "0");
     echo "<select class=\"inputbox\" size=\"{$size}\" name=\"{$name}\">\n";
     if ($toplevel) {
         $selected = "";
         if ($pid == "0") {
             $selected = 'selected="selected"';
         }
         echo "<option value=\"0\" " . $selected . ">(0) Top</option>\n";
     }
     $this->list_tree($category_id, '0', '0', $selected_categories);
     echo "</select>\n";
 }
Esempio n. 2
0
 function display($tpl = null)
 {
     global $mainframe;
     $id = JRequest::getVar('id', 0, '', 'int');
     $chemOptions = new JObject();
     $chemOptions->set('carbonLabelVisible', JRequest::getVar('carbonLabelVisible', 0, '', 'int'));
     $chemOptions->set('cpkColoring', JRequest::getVar('cpkColoring', 1, '', 'int'));
     $chemOptions->set('implicitHydrogen', JRequest::getVar('implicitHydrogen', 'TERMINAL_AND_HETERO', '', 'string'));
     $chemOptions->set('displayMode', JREquest::getVar('displayMode', 'WIREFRAME', '', 'string'));
     $chemOptions->set('bgrcolor', JRequest::getVar('bgrcolor', '#ffffff', '', 'string'));
     $chemOptions->set('zoomMode', JRequest::getVar('zoomMode', 'fit', '', 'string'));
     $chemOptions->set('width', JRequest::getVar('width', 300, '', 'int'));
     $chemOptions->set('height', JRequest::getVar('height', 300, '', 'int'));
     $this->setLayout('jsme');
     $db =& JFactory::getDBO();
     $document =& JFactory::getDocument();
     $pathway =& $mainframe->getPathway();
     // Adds parameter handling
     $params = $mainframe->getParams();
     //Set page title information
     $menus =& JSite::getMenu();
     $menu = $menus->getActive();
     // $params->set('page_title','Chem');
     $document->setTitle($params->get('page_title'));
     $params->def('show_page_title', 1);
     //$params->def( 'page_title', 'Chem Title' );
     $where = $id !== 0 ? ' where id=' . $id : '';
     $query = 'SELECT * ' . ' FROM #__chem a' . $where;
     $db->setQuery($query);
     $chem = $db->loadObjectList();
     $this->assignRef('request', $chem);
     $this->assignRef('params', $params);
     $this->assignRef('chemoptions', $chemOptions);
     parent::display($tpl);
 }
Esempio n. 3
0
 function events()
 {
     $startdate = JREquest::getVar('showdate');
     $viewtype = JREquest::getVar('viewtype', 'month');
     $cat = JREquest::getVar('cat', 'all');
     $daterange = DTrCommon::getDateRangeByViewType($startdate, $viewtype);
     $mevt = $this->getModel('event');
     $tevt = $mevt->table;
     $query = $mevt->listingQuery($daterange, $cat);
     ///  prd($query);
     $events = $tevt->query($query, null, null);
     $this->view->assign('eventTable', $tevt);
     $this->view->assign('events', $events);
     $this->display();
 }
Esempio n. 4
0
 function save()
 {
     $post = JRequest::get('post');
     $post['text_field'] = JREquest::getVar('text_field', '', 'post', 'string', JREQUEST_ALLOWRAW);
     $msgtype = 'message';
     $model = $this->getModel('textlibrary');
     if ($returnid = $model->store($post)) {
         $msg = JText::_('COM_REDEVENT_TAG_SAVED');
     } else {
         $msg = JText::_('COM_REDEVENT_TAG_SAVING_ERROR') . '<br/>' . $model->getError();
         $msgtype = 'error';
     }
     if (!$returnid || $this->getTask() == 'save') {
         $link = 'index.php?option=com_redevent&view=textlibrary';
     } else {
         $link = 'index.php?option=com_redevent&controller=textlibrary&task=edit&cid[]=' . $returnid;
     }
     $this->setRedirect($link, $msg, $msgtype);
 }
Esempio n. 5
0
 public function editElement()
 {
     JSession::checkToken('get') or jexit(JText::_('JINVALID_TOKEN'));
     jimport('joomla.utilities.date');
     jimport('joomla.user.helper');
     $user = JFactory::getUser();
     $groups = array_keys(JUserHelper::getUserGroups($user->get('id')));
     $result = new JRegistry('_default');
     $sitemapId = JREquest::getInt('id');
     if (!$user->authorise('core.edit', 'com_xmap.sitemap.' . $sitemapId)) {
         $result->setValue('result', 'KO');
         $result->setValue('message', 'You are not authorized to perform this action!');
     } else {
         $model = $this->getModel('sitemap');
         if ($model->getItem()) {
             $action = JRequest::getCmd('action', '');
             $uid = JRequest::getCmd('uid', '');
             $itemid = JRequest::getInt('itemid', '');
             switch ($action) {
                 case 'toggleElement':
                     if ($uid && $itemid) {
                         $state = $model->toggleItem($uid, $itemid);
                     }
                     break;
                 case 'changeProperty':
                     $uid = JRequest::getCmd('uid', '');
                     $property = JRequest::getCmd('property', '');
                     $value = JRequest::getCmd('value', '');
                     if ($uid && $itemid && $uid && $property) {
                         $state = $model->chageItemPropery($uid, $itemid, 'xml', $property, $value);
                     }
                     break;
             }
         }
         $result->set('result', 'OK');
         $result->set('state', $state);
         $result->set('message', '');
     }
     echo $result->toString();
 }
Esempio n. 6
0
$db = JFactory::getDBO();
$helpval = new JApplication();
if (empty($medias)) {
    echo "<strong>" . JText::_("GURU_MEDIA_NOMED") . "</strong>";
    $helpval->close();
}
$n = count($medias);
$sql = "select count(*) from #__guru_media";
$db->setQuery($sql);
$db->query();
$count = $db->loadresult();
if (!isset($count) || $count == 0) {
    echo "<b>" . JText::_("GURU_NO_MEDIA") . "</b>";
    return;
}
$second = JREquest::getVAR("second", "", "get");
if ($second == "ok") {
    $value = $_SESSION['median_number'];
    $value++;
    $_SESSION['median_number'] = $value;
}
?>
<style>
	table.adminlist {
		background-color:#E7E7E7;
		border-spacing:1px;
		color:#666666;
		width:100%;
		font-family:Arial,Helvetica,sans-serif;
		font-size:11px;
	}
Esempio n. 7
0
<?php

/*
 * @package WSShoutBox
 * @copyright (C) 2009 Wael Nasreddine <*****@*****.**>, Steve <STEVE EMAIL HERE>
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * Distributed under the GPL - see LICENSE
 */
// No direct access
defined('_JEXEC') or die('Restricted access');
// Require the base controller if requested
if ($controller = JRequest::getWord('controller')) {
    $path = JPATH_COMPONENT . DS . 'controllers' . DS . $controller . '.php';
    if (file_exists($path)) {
        require_once $path;
    } else {
        $controller = '';
    }
}
// Create the controller
$classname = 'WSShoutBoxController' . $controller;
$controller = new $classname();
// Perform the requested task
$controller->execute(JREquest::getVar('task'));
// Redirect if set by the controller
$controller->redirect();
/*
 * No closing PHP tag to avoid the risk of sending the headers to the browser !!
 */
Esempio n. 8
0
    public static function showMailingQueue($mailingq = null, $lists = null, $form, $start, $limit, $mailingsearch, $setLimit = null, $setSort = null)
    {
        $listId = null;
        ?>

		<script language="javascript" type="text/javascript">
		<!--
			function jnewsselectall(){
				var i = 0;
				allcheck = document.getElementById("selectallcheck");
				if(allcheck.checked) checkedvalue = 1;
				else checkedvalue = 0;

				while(myelement = document.getElementById("cid["+i+"]")){
					myelement.checked = checkedvalue;
					i++;
				}

				if(checkedvalue){
					document.getElementById("boxcount").value = i;
				}else{
					document.getElementById("boxcount").value = 0;
				}
			}

		 //-->
		</script>
		<?php 
        if (empty($mailingq)) {
            echo '<center>' . jnews::printYN(true, _JNEWS_Q_M1, _JNEWS_ERROR) . '</center>';
        }
        if ($listId == 0) {
            $message = _JNEWS_MESSAGE_QUEUE;
        } else {
            $lt_name = jNews_Lists::getLists($listId, 0, null, '', false, false, true, false, false, '');
            $message = _JNEWS_SUSCRIB_LIST_UNIQUE . "<span style='color: rgb(51, 51, 51);'>" . @$lt_name[0]->list_name . "</span>";
        }
        if (!isset($action)) {
            $action = JRequest::getVar('act', '', '', 'WORD');
        }
        $mySepList = array();
        $mySepList[0] = new stdClass();
        $mySepList[0]->subject = 'All Mailings';
        $mySepList[0]->id = 0;
        $myMailingQueA = jNews_Mailing::getMailingsForQueue();
        if (empty($myMailingQueA) || !is_array($myMailingQueA)) {
            $myMailingQueA = array();
        }
        $lt = array_merge($mySepList, $myMailingQueA);
        $mailingId = JREquest::getVar('mailingid', '');
        $dropDown = jnews::HTML_GenericList($lt, 'mailingid', '' . 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'id', 'subject', $mailingId);
        $filter = _JNEWS_FILTER_MAILING . $dropDown;
        $hidden = '<input type="hidden" name="option" value="' . JNEWS_OPTION . '" />';
        $hidden .= '<input type="hidden" name="act" value="' . $action . '" />';
        $hidden .= '<input type="hidden" name="limit" value="' . $limit . '" />';
        ?>

	<?php 
        echo $form['main'];
        if ($form['main'] !== "") {
            $form['select'] = "";
        }
        // top portion before the table list
        // for search
        $toSearch = new stdClass();
        $toSearch->forms = $form['select'];
        $toSearch->hidden = $hidden;
        $toSearch->listsearch = $mailingsearch;
        $toSearch->id = 'mailingsearch';
        echo jnews::setTop($toSearch, $message, $setLimit, $filter);
        ?>
		<table class="<?php 
        echo jnews::myTheme();
        ?>
">
			<thead><tr>
				<th width="2%" class="title">#</th>
				<th width="2%" class="title"><input type="checkbox" id="selectallcheck" name="allchecked" onclick="jnewsselectall();"></th>
				<th width="22%" class="title"><?php 
        echo jnews::HTML_GridSort(_JNEWS_QUEUE_SUBJECT, 'm.subject', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
				<th width="22%" class="title"><?php 
        echo jnews::HTML_GridSort(_JNEWS_QUEUE_EMAIL, 's.email', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
				<th width="22%" class="title"><?php 
        echo jnews::HTML_GridSort(_JNEWS_SENDDATE, 'q.send_date', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
				<th width="3%" class="title"><center><?php 
        echo jnews::HTML_GridSort(_JNEWS_QUEUE_PRIOR, 'q.priority', $setSort->orderDir, $setSort->orderValue);
        ?>
</center></th>
				<th width="2%" class="title"><center><?php 
        echo jnews::HTML_GridSort(_JNEWS_QUEUE_ATT, 'q.attempt', $setSort->orderDir, $setSort->orderValue);
        ?>
</center></th>
				<th width="3%" class="title"><?php 
        echo jnews::HTML_GridSort('Suspend', 'q.suspend', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
				<th width="3%" class="title"><?php 
        echo jnews::HTML_GridSort('Blocked', 'q.block', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
				<th width="3%" class="title"><?php 
        echo jnews::HTML_GridSort('ID', 'q.qid', $setSort->orderDir, $setSort->orderValue);
        ?>
</th>
			</thead></tr>
			<?php 
        $i = $start;
        jNews_QueueHTML::_displayQueue($mailingq, $i);
        ?>
		</table>
		<?php 
        echo '<br />';
        echo jnews::setLegend();
    }