Pour une expériencenet et une sécurité optimale, mettez à jour votre navigateur. Mettre à jour maintenant




choco or choco -? now.Everything you need to know to build great looking charts using Chart.js
onsubmit="return hideSubmit();"
// Get a handle to the Joomla! application object $application = JFactory::getApplication(); // Add a message to the message queue $application->enqueueMessage(JText::_('SOME_ERROR_OCCURRED'), 'error'); /** Alternatively you may use chaining */ JFactory::getApplication()->enqueueMessage(JText::_('SOME_ERROR_OCCURRED'), 'error');
<jdoc:include type="message" />
JFactory::getApplication()->enqueueMessage('Message');
JError::raiseNotice( 100, 'Notice' );
JError::raiseWarning( 100, 'Warning' );
JError::raiseError( 4711, 'A severe error occurred' );
JFactory::getApplication()->enqueueMessage('Your Message', 'type');
Online Help Anthony Crovella 1.0.0 module composant (a mettre en trad) mod_composant.xml mod_composant.php index.html helper.php tmpl/default.php tmpl/index.html
// no direct access defined('_JEXEC') or die;
require JModuleHelper::getLayoutPath('mod_composant', $params->get('layout', 'default'));?>// No direct access defined('_JEXEC') or die;JHtml::_('behavior.keepalive'); JHtml::_('bootstrap.tooltip'); ?>
"list" >>JGLOBAL_SORT_BY >JGRID_HEADING_ID_ASC >JGRID_HEADING_ID_DESC
protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
// Load the filter state.
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$state = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state', '', 'string');
$this->setState('filter.state', $state);
// Load the parameters.
$params = JComponentHelper::getParams('com_letest');
$this->setState('params', $params);
// List state information.
parent::populateState('id', 'asc');
} 
protected function getOptions()
{
// Initialize variables.
$options = array();
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('id As value, section As text')
->from('#__matable AS a')
->order('a.section');
// Get the options.
$db->setQuery($query);
$options = $db->loadObjectList();
// Check for a database error.
if ($db->getErrorNum()) {
JError::raiseWarning(500, $db->getErrorMsg());
}
return $options;
} if ($section = $this->getState('filter.section'))
{
var_dump($this->getState('filter.section'));
$query->where('section = ' . $db->quote($section));
echo $query;
} protected function getOptions()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select ('distinct section As value, section As text')
->from('#__matable AS a')
->group('value');
// Get the options.
$db->setQuery($query);
try
{
$options = $db->loadObjectList();
}
catch (RuntimeException $e)
{
JError::raiseWarning(500, $e->getMessage());
}
// Merge any additional options in the XML definition.
// $options = array_merge(parent::getOptions(), $options);
array_unshift($options, JHtml::_('select.option', '0', JText::_('COM_MONCOMPOSANT_SECTION')));
return $options;
}
} Code PHP:// Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
$query->where('published = ' . (int) $published);
}
elseif ($published === '')
{
$query->where('(published IN (0, 1))');
}
//filter by section
if ($section = $this->getState('filter.section'))
{
$query->where('section = ' . $db->quote($section));
}
Code PHP:
echo JText::_('COM_ONLINEHELP_ONLINEHELPS_FILTER'); ?> echo JLayoutHelper::render(
'joomla.searchtools.default',
array('view' => $this)
);
?>
method="post" action="components\com_onlinehelp\controllers\formulaire.php"> >Ton pseudo :"text" id="pseudo" name="pseudo" required /> >Tu es : "radio" id="genre_m" name="genre" /> un garçon "radio" id="genre_f" name="genre" /> une fille >Ton âge :"number" id="age" name="age" required /> >Ta question : name="question" required cols="30" rows="8"> Ici tu peux écrire le texte de ta demande. Tu peux nous écrire en français, en allemand, en anglais. Tu peux agrandir le champ texte en tirant avec le pointeur sur l'angle en bas à droite"text-align:center;">"submit" name="envoi" value="Envoyer ma question" />
if(isset($_POST['pseudo'])) $pseudo=$_POST['pseudo'];
else $pseudo="";
if(isset($_POST['genre'])) $genre=$_POST['genre'];
else $genre="";
if(isset($_POST['age'])) $age=$_POST['age'];
else $age="";
if(isset($_POST['question'])) $question=$_POST['question'];
else $question=""; // On vérifie si les champs sont vides if(empty($pseudo) OR empty($genre) OR empty($age) OR empty($question))
{
echo 'Attention, tous les champs sont obligatoires !';
} Ensuite voila a quoi ressemble mon fichier view.html.php :Code PHP (la vue):
Code PHP (view.html.php) il récupére le form et le passe à la vue ce qui permet de faire les traitements:class OnlineHelpViewOnlineHelp extends JViewLegacy { // Overwriting JView display method
function display($tpl = null)
{
// Assign data to the view
$this->form = $this->get('Form');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JLog::add(implode('
', $errors), JLog::WARNING, 'jerror');
return false;
}
// Display the view
parent::display($tpl);
}
}
Code PHP (confirmation.php : le model) :/**
* Get the pseudo
* @return string The pseudo to be displayed to the user
*/
public function getPseudo()
{
$jinput = JFactory::getApplication()->input;
if (!isset($this->pseudo))
{
$this->pseudo = $jinput->get('pseudo');
}
return $this->pseudo;
}
/**
* Get the code question
* @return string The code unique to be displayed to the user
*/
public function getCode_unique()
{
$jinput = JFactory::getApplication()->input;
if (!isset($this->code_unique))
{
$this->code_unique = $jinput->get('code_unique');
}
return $this->code_unique;
}
$data[code_question] = uniqid(); Ensuite on assigne nos données a la vue (via le fichier view.html.php de notre vue 'confirm)Code PHP:$this->setRedirect(JRoute::_('index.php?option=com_composant&view=confirm&pseudo='.$data[pseudo].'&code_unique='.$data[code_question],false));
class ComposantViewConfirm extends JViewLegacy { // Overwriting JView display method
function display($tpl = null)
{
// Assign data to the view
$this->pseudo = $this->get('Pseudo');
$this->code_question = $this->get('Code_unique');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JLog::add(implode('
', $errors), JLog::WARNING, 'jerror');
return false;
}
// Display the view
parent::display($tpl);
}
} (les longue chaine de majuscules sont des label, j'utilise un fichier de traduction il n'y a donc aucun texte en dur dans le code)Code PHP:echo JText::_('COM_COMPOSANT_MSG_CONFIRMATION_PSEUDO'); echo $this->pseudo ; ?>
echo JText::_('COM_COMPOSANT_MSG_CONFIRMATION_CODE_UNIQUE'); echo $this->code_unique; ?>
| Type | Description | Availability |
|---|---|---|
| accesslevel | provides a drop down list of viewing access levels. | |
| cachehandler | provides a list of available cache handling options. | |
| calendar | provides a text box for entry of a date. An icon next to the text box provides a link to a pop-up calendar, which can also be used to enter the date value. | |
| captcha | provides a drop down list of the captcha plugins. | |
| category | provides a drop down list of categories for an extension. | |
| checkbox | provides a single checkbox to be checked or unchecked | |
| checkboxes | provides unlimited checkboxes that can be used for multi-select. | |
| Chrome Style | provides a list of template chrome style options grouped by template. | |
| color | provides a color picker when clicking the input box. | |
| Content Language | Provides a list of content languages. | |
| Content Type | Provides a list of content types. | |
| combo | provides a combo box field. | |
| componentlayout | provides a grouped list of core and template alternate layouts for a component item. | |
| contentlanguage | provides a list of installed content languages for use in conjunction with the language switcher plugin. | |
| Database Connection | Provides a list of available database connections, optionally limiting to a given list. | |
| editor | provides an editor area field. | |
| editors | Provides a drop down list of the available WYSIWYG editors. Since | |
| provides an email field. | ||
| file | ||
| filelist | provides a drop down list of files from a specified directory. | |
| folderlist | provides a drop down list of folders from a specified directory. | |
| groupedlist | provides a drop down list of items organized into groups. | |
| header tag | provides a drop down list of the header tags (h1-h6). | |
| helpsite | provides a drop down list of the help sites for your Joomla installation. | |
| hidden | provides a hidden field for saving a form field whose value cannot be altered directly by a user in the Administrator (it can be altered in code or by editing the params.ini file). | |
| imagelist | provides a drop down list of image files in a specified directory. | |
| integer | provides a drop down list of integers between a minimum and maximum. | |
| language | provides a drop down list of the installed languages for the Front-end or Back-end. | |
| list | provides a drop down list of custom-defined entries. | |
| media | provides modal access to the media manager for insertion of images with upload for users with appropriate permissions. | |
| menu | provides a drop down list of the available menus from your Joomla site. | |
| Menu Item | provides a drop down list of the available menu items from your Joomla site. | |
| Module Layout | provides a list of alternative layout for a module grouped by core and template. | |
| Module Order | Provides a drop down to set the ordering of module in a given position | |
| Module Position | provides a text input to set the position of a module. | |
| Module Tag | provides a list of html5 elements (used to wrap a module in). | |
| note | supports a one line text field. | |
| password | provides a text box for entry of a password. The password characters will be obscured as they are entered. | |
| plugins | provides a list of plugins from a given folder. | |
| radio | provides radio buttons to select different options. | |
| repeatable | Allows form fields which can have as many options as the user desires. | |
| rules | provides a matrix of group by action options for managing access control. Display depends on context. | |
| sessionhandler | provides a drop down list of session handler options. | |
| spacer | provides a visual separator between form fields. It is purely a visual aid and no value is stored. | |
| sql | provides a drop down list of entries obtained by running a query on the Joomla Database. The first results column returned by the query provides the values for the drop down box. | |
| tag | provides an entry point for tags (either AJAX or Nested). | |
| tel | provides an input field for a telephone number. | |
| templatestyle | provides a drop down list of template styles. | |
| text | provides a text box for data entry. | |
| textarea | provides a text area for entry of multi-line text. | |
| timezone | provides a drop down list of time zones. | |
| URL | provides a URL text input field. | |
| user | provides a modal list of users. | |
| usergroup | provides a drop down list of user groups. |
protected function populateState($ordering = null, $direction = null) { parent::populateState('default_column_name', 'ASC'); }
public function __construct($config = array()) { $config['filter_fields'] = array( 'column_name_1', 'column_name_2', // ... 'column_name_3' ); parent::__construct($config); }
public function getListQuery() { $db = JFactory::getDbo(); $query = $db->getQuery(true); // ... $query->order($db->escape($this->getState('list.ordering', 'default_sort_column')).' '. $db->escape($this->getState('list.direction', 'ASC'))); return $query; }
public function display($tpl=null) { $items = $this->get('Items'); $state = $this->get('State'); $this->sortDirection = $state->get('list.direction'); $this->sortColumn = $state->get('list.ordering'); parent::display($tpl); }
<form id="adminForm" method="post" name="adminForm"> .... table goes here .... form>
<tr> <th>Nameth> <th>Descriptionth> tr>
echo JHTML::_( 'grid.sort', 'Name', 'DbNameColumn', $this->sortDirection, $this->sortColumn); ?> echo JHTML::_( 'grid.sort', 'Description', 'DbDescriptionColumn', $this->sortDirection, $this->sortColumn); ?>
<script language="javascript" type="text/javascript"> function tableOrdering( order, dir, task ) { var form = document.adminForm; form.filter_order.value = order; form.filter_order_Dir.value = dir; document.adminForm.submit( task ); } script>
div.btn { padding: 0 10px 0 10px; }
"btn">"#">BOUTTON
d2064d358136996bd22421584a7cb33e:trd7TvKHx6dMeoMmBVxYmg0vuXEA4199
<div id="id_div_1" style="display:none;"> Texte à masquer, afficher
div>
<a href="" onclick="javascript:visibilite('id_div_1'); return false;" >Liena>
<script>
function visibilite(thingId)
{
var targetElement;
targetElement = document.getElementById(thingId) ;
if (targetElement.style.display == "none")
{
targetElement.style.display = "" ;
} else {
targetElement.style.display = "none" ;
}
}
script>
.date {
width: 80px; height: 96px;
background: #fcfcfc;
background: linear-gradient(top, #fcfcfc 0%,#dad8d8 100%);
background: -moz-linear-gradient(top, #fcfcfc 0%, #dad8d8 100%);
background: -webkit-linear-gradient(top, #fcfcfc 0%,#dad8d8 100%);
border: 1px solid #d2d2d2;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
margin-left: -8%;
}
.date p {
font-family: Helvetica, sans-serif;
font-size: 53px; text-align: center; color: #9e9e9e;
margin-top: 25px;
}
.date p span {
background: #e84542;
background: linear-gradient(top, #e84542 0%, #7a0909 100%);
background: -moz-linear-gradient(top, #e84542 0%, #7a0909 100%);
background: -webkit-linear-gradient(top, #e84542 0%, #7a0909 100%);
font-size: 33px; font-weight: bold; color: #fff; text-transform: uppercase; display: block;
border-radius: 0 0 10px 10px;
-moz-border-radius: 0 0 10px 10px;
-webkit-border-radius: 0 0 10px 10px;
padding: 9px 0 10px 0;
margin-top: 16px;
}
24 JUIL
get('show_create_date')) : ?>
created, 'd'); ?> created, 'M') ?>