developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #938: patch_938_v1.diff

File patch_938_v1.diff, 3.0 KB (added by mike, 11 years ago)

the first patch, try it!

  • jelix-scripts/templates/var/config/defaultconfig.ini.php.tpl

     
    2525; or not installed.
    2626unusedModules = jacldb
    2727
     28; default domain name to use with jfullurl for example. Let it empty to use $_SERVER['SERVER_NAME'] value instead.
     29;domainName = mydomain.com
     30
    2831[coordplugins]
    2932;nom = nom_fichier_ini
    3033
     
    187190datepicker = default
    188191
    189192[datepickers]
    190 default = jelix/js/jforms/datepickers/default/init.js
    191  No newline at end of file
     193default = jelix/js/jforms/datepickers/default/init.js
  • jelix/plugins/tpl/html/function.jfullurl.php

     
     1<?php
     2/**
     3* @package    jelix
     4* @subpackage jtpl_plugin
     5* @version    $Id$
     6* @author     Mickael Fradin aka kewix
     7* @copyright  2009 Mickael Fradin
     8* @link       http://www.jelix.org
     9* @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
     10*/
     11
     12/**
     13 * function plugin :  write the full url (with domain name) corresponding to the given jelix action
     14 *
     15 * @param jTpl $tpl template engine
     16 * @param string $selector selector action
     17 * @param array $params parameters for the url
     18 * @param string domain name, false if you want to use the config domain name or the server name
     19 * @param boolean $escape if true, then escape the string for html
     20 */
     21function jtpl_function_html_jfullurl($tpl, $selector, $params=array(), $domain=false, $escape=true) {
     22    global $gJConfig;
     23
     24    // Find the right domain name in the following order: function parameter, configuration variable, $_SERVER['SERVER_NAME']
     25    if (!$domain) {
     26        if (isset($gJConfig->domainName) && !empty($gJConfig->domainName))
     27            $domain = $gJConfig->domainName;
     28        else if (isset($_SERVER['SERVER_NAME']))
     29            $domain = $_SERVER['SERVER_NAME'];
     30        else
     31            $domain = '';
     32    }
     33
     34    // Add the http or https if not given
     35    if (!preg_match('/^http/', $domain)) {
     36        if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] && $_SERVER['HTTPS']!='off'))
     37            $domain = 'https://'.$domain;
     38        else
     39            $domain = 'http://'.$domain;
     40    }
     41
     42    // echo the full Url
     43    echo $domain.jUrl::get($selector, $params, ($escape?1:0));
     44}
  • jelix/CREDITS

     
    116116 - added style feature in the meta_html plugin (#553)
    117117 - little other improvements (#835)
    118118 - fixed bugs (#884)
     119 - added jfullurl tpl plugin (#938)
    119120
    120121Baptiste Toinot (aka Surfoo)
    121122 - double / in path for locale selector