mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
EONE-11, EONE-22 (Tasks): initial e_WEB folder structure, calendar moved from handler folder to the new 'package' folder
This commit is contained in:
@@ -1,16 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://gnu.org).
|
* GNU General Public License (http://gnu.org).
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/calendar/calendar_class.php,v $
|
* $URL$
|
||||||
* $Revision$
|
* $Id$
|
||||||
* $Date$
|
*
|
||||||
* $Author$
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,23 +35,23 @@ class DHTML_Calendar
|
|||||||
{
|
{
|
||||||
if ($stripped)
|
if ($stripped)
|
||||||
{
|
{
|
||||||
$this->calendar_file = e_HANDLER_ABS.'calendar/calendar_stripped.js';
|
$this->calendar_file = e_PACK_ABS.'calendar/calendar_stripped.js';
|
||||||
$this->calendar_setup_file = e_HANDLER_ABS.'calendar/calendar-setup_stripped.js';
|
$this->calendar_setup_file = e_PACK_ABS.'calendar/calendar-setup_stripped.js';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->calendar_file = e_HANDLER_ABS.'calendar/calendar.js';
|
$this->calendar_file = e_PACK_ABS.'calendar/calendar.js';
|
||||||
$this->calendar_setup_file = e_HANDLER_ABS.'calendar/calendar-setup.js';
|
$this->calendar_setup_file = e_PACK_ABS.'calendar/calendar-setup.js';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(file_exists(e_HANDLER.'calendar/language/'.e_LANGUAGE.'.js'))
|
if(file_exists(e_WEB_PACK.'calendar/languages/'.e_LANGUAGE.'.js'))
|
||||||
{
|
{
|
||||||
$this->calendar_lang_file = e_HANDLER_ABS.'calendar/language/'.e_LANGUAGE.'.js';
|
$this->calendar_lang_file = e_PACK_ABS.'calendar/languages/'.e_LANGUAGE.'.js';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->calendar_lang_file = e_HANDLER_ABS.'calendar/language/English.js';
|
$this->calendar_lang_file = e_PACK_ABS.'calendar/languages/English.js';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(defined('CALENDAR_IMG'))
|
if(defined('CALENDAR_IMG'))
|
||||||
@@ -62,7 +60,7 @@ class DHTML_Calendar
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->calendar_img = "<img style='vertical-align:middle;' src='".e_HANDLER_ABS."calendar/cal.gif' alt='' />";
|
$this->calendar_img = "<img class='icon action' src='".e_PACK_ABS."calendar/images/cal.gif' alt='' />";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(file_exists(THEME."calendar.css"))
|
if(file_exists(THEME."calendar.css"))
|
||||||
@@ -71,7 +69,7 @@ class DHTML_Calendar
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->calendar_theme_file = e_HANDLER_ABS."calendar/calendar.css";
|
$this->calendar_theme_file = e_PACK_ABS."calendar/calendar.css";
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->calendar_options = array('ifFormat' => '%Y/%m/%d', 'daFormat' => '%Y/%m/%d');
|
$this->calendar_options = array('ifFormat' => '%Y/%m/%d', 'daFormat' => '%Y/%m/%d');
|
||||||
@@ -107,14 +105,14 @@ class DHTML_Calendar
|
|||||||
$id = $this->_gen_id();
|
$id = $this->_gen_id();
|
||||||
$attrstr = $this->_make_html_attr(array_merge($field_attributes, array('id' => $this->_field_id($id), 'type' => 'text')));
|
$attrstr = $this->_make_html_attr(array_merge($field_attributes, array('id' => $this->_field_id($id), 'type' => 'text')));
|
||||||
$ret .= '<input ' . $attrstr .'/> ';
|
$ret .= '<input ' . $attrstr .'/> ';
|
||||||
|
|
||||||
//TODO perhaps make an admin-pref option for this. Default should be without the trigger-image.
|
//TODO perhaps make an admin-pref option for this. Default should be without the trigger-image.
|
||||||
// $ret .= "<a href='#' id='".$this->_trigger_id($id)."'>".$this->calendar_img."</a>";
|
// $ret .= "<a href='#' id='".$this->_trigger_id($id)."'>".$this->calendar_img."</a>";
|
||||||
// $options = array_merge($cal_options, array('inputField' => $this->_field_id($id), 'button' => $this->_trigger_id($id)));
|
// $options = array_merge($cal_options, array('inputField' => $this->_field_id($id), 'button' => $this->_trigger_id($id)));
|
||||||
|
|
||||||
$options = array_merge($cal_options, array('inputField' => $this->_field_id($id), 'button' => null));
|
$options = array_merge($cal_options, array('inputField' => $this->_field_id($id), 'button' => null));
|
||||||
|
|
||||||
e107::getJs()->footerInline($this->_make_calendar($options, false));
|
e107::getJs()->footerInline($this->_make_calendar($options, false));
|
||||||
//JS manager to send JS to header if possible, if not - footer
|
//JS manager to send JS to header if possible, if not - footer
|
||||||
e107::getJs()
|
e107::getJs()
|
||||||
->tryHeaderFile($this->calendar_file)
|
->tryHeaderFile($this->calendar_file)
|
||||||
|
@@ -1,47 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once('../../class2.php');
|
|
||||||
require_once(e_HANDLER."calendar/calendar_class.php");
|
|
||||||
$cal = new DHTML_Calendar(true);
|
|
||||||
function headerjs()
|
|
||||||
{
|
|
||||||
global $cal;
|
|
||||||
return $cal->load_files();
|
|
||||||
}
|
|
||||||
require_once(HEADERF);
|
|
||||||
|
|
||||||
echo "
|
|
||||||
<table style='border:2px solid'>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
";
|
|
||||||
echo $cal->make_input_field(
|
|
||||||
// calendar options go here; see the documentation and/or calendar-setup.js
|
|
||||||
array('showsTime' => true,
|
|
||||||
'showOthers' => true,
|
|
||||||
'ifFormat' => '%Y/%m/%d %I:%M %P',
|
|
||||||
'weekNumbers' => false,
|
|
||||||
'timeFormat' => '12'),
|
|
||||||
// field attributes go here
|
|
||||||
array('style' => 'color: #840; background-color: #ff8; border: 1px solid #000; text-align: center',
|
|
||||||
'name' => 'date1',
|
|
||||||
'value' => strftime('%Y/%m/%d %I:%M %P', strtotime('now'))));
|
|
||||||
|
|
||||||
|
|
||||||
echo "</td></tr><tr><td>";
|
|
||||||
unset($cal_options);
|
|
||||||
unset($cal_attrib);
|
|
||||||
$cal_options['showsTime'] = false;
|
|
||||||
$cal_options['showOthers'] = false;
|
|
||||||
$cal_options['weekNumbers'] = true;
|
|
||||||
$cal_attrib['class'] = "tbox";
|
|
||||||
$cal_attrib['name'] = "date2";
|
|
||||||
$cal_attrib['value'] = "[select date]";
|
|
||||||
echo $cal->make_input_field($cal_options, $cal_attrib);
|
|
||||||
echo "
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
";
|
|
||||||
require_once(FOOTERF);
|
|
||||||
|
|
||||||
?>
|
|
@@ -19,7 +19,7 @@
|
|||||||
* than modifying calendar.js itself).
|
* than modifying calendar.js itself).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// $Id$
|
// $Id: calendar-setup.js 11315 2010-02-10 18:18:01Z secretr $
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function "patches" an input field (or other element) to use a calendar
|
* This function "patches" an input field (or other element) to use a calendar
|
@@ -12,7 +12,7 @@
|
|||||||
* Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
|
* Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// $Id$
|
// $Id: calendar.js 11315 2010-02-10 18:18:01Z secretr $
|
||||||
|
|
||||||
/** The Calendar object constructor. */
|
/** The Calendar object constructor. */
|
||||||
Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) {
|
Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) {
|
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 223 B |
Before Width: | Height: | Size: 68 B After Width: | Height: | Size: 68 B |
Before Width: | Height: | Size: 49 B After Width: | Height: | Size: 49 B |
Reference in New Issue
Block a user