Ejemplo n.º 1
0
    /**
     * 
     * 
     * @param 
     * @access public
     * @return void 
     */
    public static function addCalendar($caller, $params, $currentData)
    {
        $params = explode(',', $params);
        if (!isset($params[0]) || !isset($params[1])) {
            return '';
        }
        $lang = isset($GLOBALS['SITECONF']['CONFIG']['lang']) && isset($GLOBALS['LIBCONF']['template']['includeCalendar']['js_lang'][$GLOBALS['SITECONF']['CONFIG']['lang']]) ? $GLOBALS['SITECONF']['CONFIG']['lang'] : 'fr';
        foreach ($GLOBALS['LIBCONF']['template']['includeCalendar']['css'] as $k => $v) {
            headmgr::addCssFile($v);
        }
        foreach ($GLOBALS['LIBCONF']['template']['includeCalendar']['js'] as $k => $v) {
            headmgr::addJsFile($v);
        }
        headmgr::addJsFile($GLOBALS['LIBCONF']['template']['includeCalendar']['js_lang'][$lang]);
        $content = '<a id="' . $params[1] . '" href="#"><img src="' . $GLOBALS['SITECONF']['CONFIG']['baseUrl'] . 'public/images/cal.png"/></a><script type="text/javascript">
			Calendar.setup({
				inputField : "' . $params[0] . '",
				trigger    : "' . $params[1] . '",
				onSelect   : function() { this.hide()},
				dateFormat : "%d/%m/%Y"
			});
		</script>';
        return $content;
    }
Ejemplo n.º 2
0
 /**
  * 
  * 
  * @param 
  * @access public
  * @return void 
  */
 protected function getmarkerArray()
 {
     $content = '';
     $title = '';
     //pour le cas d'une réécriture d'url
     if (isset($_SERVER['PATH_INFO']) && trim($_SERVER['PATH_INFO'])) {
         $info = explode('/', trim($_SERVER['PATH_INFO']));
         if (trim($_SERVER['PATH_INFO']) != '/') {
             if (isset($info[1]) && trim($info[1]) && ($info[1] == 'declic' || $info[1] == 'pixel')) {
                 $type = trim($info[1]);
                 $module = isset($info[2]) && trim($info[2]) ? trim($info[2]) : '';
             } else {
                 $type = '';
                 $module = isset($info[1]) && trim($info[1]) ? trim($info[1]) : '';
             }
         } else {
             $module = $GLOBALS['SITECONF']['CONFIG']['defaultModule'];
             $type = $GLOBALS['SITECONF']['CONFIG']['defaultType'];
         }
     } elseif (isset($_GET['module']) && trim($_GET['module'])) {
         $module = trim($_GET['module']);
         $type = isset($_GET['type']) && trim($_GET['type']) ? trim($_GET['type']) : '';
     } else {
         $module = $GLOBALS['SITECONF']['CONFIG']['defaultModule'];
         $type = $GLOBALS['SITECONF']['CONFIG']['defaultType'];
     }
     if (!div::moduleExist($module, $type)) {
         $module = 'error404';
         $type = '';
     }
     if (div::redirectAuth($module, $type)) {
         $redirect = array('type' => $type, 'module' => $module == 'authentification' ? $GLOBALS['SITECONF']['CONFIG']['defaultModule'] : $module);
         $module = 'authentification';
         $path = PATH_MODULE;
         $path .= $module . '/';
         $className = 'm_' . $module;
         require_once $path . $className . '.php';
         $class = new $className('', $module);
         $content = $class->main($redirect);
         $title = $class->titlePage;
     } else {
         $path = PATH_MODULE;
         if ($type) {
             $path .= $type . '/';
         }
         $path .= $module . '/';
         $className = 'm_' . $module;
         require_once $path . $className . '.php';
         $class = new $className($type, $module);
         $content = $class->main();
         $title = $class->titlePage;
     }
     $currentType = $type ? $type : (isset($class->type) ? $class->type : '');
     $markerArray = array('title' => $title, 'content' => $content, 'header' => headmgr::getHeader());
     if (isset($GLOBALS['CONF']['addMarker'])) {
         foreach ($GLOBALS['CONF']['addMarker'] as $k => $v) {
             $markerArray[$k] = div::callUserFunc($v, array($type, $module, $currentType), $this);
         }
     }
     return $markerArray;
 }