diff --git a/e107_admin/credits.php b/e107_admin/credits.php
index 990b1d193..774ffeb2f 100644
--- a/e107_admin/credits.php
+++ b/e107_admin/credits.php
@@ -63,12 +63,6 @@ $creditsArray = array(
"version" => "0.1",
"licence" => "GPL, ".CRELAN_8
),
- array( "name" => "DHTML / JavaScript Calendar",
- "url" => "http://www.dynarch.com/projects/",
- "description" => CRELAN_17,
- "version" => "1.0",
- "licence" => "GPL"
- ),
array( "name" => "FPDF",
"url" => "http://www.fpdf.org/",
"description" => CRELAN_18,
diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php
index 5ab364313..bc9e21304 100644
--- a/e107_admin/newspost.php
+++ b/e107_admin/newspost.php
@@ -728,8 +728,7 @@ class admin_newspost
require_once(e_HANDLER."cache_handler.php");
require_once(e_HANDLER."news_class.php");
- // require_once(e_HANDLER."calendar/calendar_class.php");
- // $this->_cal = new DHTML_Calendar(true);
+
$this->_pst = $pstobj;
@@ -1077,7 +1076,7 @@ class admin_newspost
$_POST['news_start'] = vartrue(e107::getDate()->convert($_POST['news_start'],'inputdatetime'), 0);
-echo "date=".$_POST['news_start'];
+// echo "date=".$_POST['news_start'];
if($_POST['news_start'])
{
// $_POST['news_start'] = e107::getDate()->convert($_POST['news_start']);
diff --git a/e107_admin/users_extended.php b/e107_admin/users_extended.php
index 8166eab3d..ca830899b 100755
--- a/e107_admin/users_extended.php
+++ b/e107_admin/users_extended.php
@@ -34,16 +34,13 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
$e_sub_cat = 'user_extended';
$curtype = '1';
-require_once(e_HANDLER.'calendar/calendar_class.php');
require_once(e_HANDLER.'message_handler.php');
-$cal = new DHTML_Calendar(true);
require_once("auth.php");
require_once(e_HANDLER.'user_extended_class.php');
require_once(e_HANDLER.'userclass_class.php');
-require_once(e_HANDLER.'form_handler.php');
-$frm = new e_form;
+$frm = e107::getForm();
$ue = new e107_user_extended;
@@ -1264,9 +1261,6 @@ function headerjs()
";
- global $cal;
- $text .= $cal->load_files();
-
echo $text;
}
?>
\ No newline at end of file
diff --git a/e107_files/jslib/core/all.jquery.js b/e107_files/jslib/core/all.jquery.js
index 192467e2e..0753c5cd3 100644
--- a/e107_files/jslib/core/all.jquery.js
+++ b/e107_files/jslib/core/all.jquery.js
@@ -15,7 +15,8 @@ $(document).ready(function()
$("input.e-date").each(function() {
$(this).datepicker({
dateFormat: $(this).attr("data-date-format"),
- ampm: $(this).attr("data-date-ampm")
+ ampm: $(this).attr("data-date-ampm"),
+ showButtonPanel: true
});
});
@@ -23,7 +24,8 @@ $(document).ready(function()
$(this).datetimepicker({
dateFormat: $(this).attr("data-date-format"),
timeFormat: $(this).attr("data-time-format"),
- ampm: $(this).attr("data-date-ampm")
+ ampm: $(this).attr("data-date-ampm"),
+ showButtonPanel: true
});
});
diff --git a/e107_files/popup.js b/e107_files/popup.js
deleted file mode 100644
index 13a91f789..000000000
--- a/e107_files/popup.js
+++ /dev/null
@@ -1,159 +0,0 @@
-window.defaultStatus = "";
-
-//get reference object for popup
-function getRefToDivMod( divID, oDoc ) {
- if( !oDoc ) { oDoc = document; }
- if( document.layers ) {
- if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
- for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
- y = getRefToDivMod(divID,oDoc.layers[x].document);
- }
- return y;
- }
- }
- if( document.getElementById ) { return oDoc.getElementById(divID); }
- if( document.all ) { return oDoc.all[divID]; }
- return document[divID];
-}
-
-
-//resize method for popup window (resize to fit contents)
-function resizeWinTo() {
- if( !document.images.length ) { document.images[0] = document.layers[0].images[0]; }
- if( !document.images[0].height || window.doneAlready ) { return false; } //in case images are disabled
- var oH = getRefToDivMod( 'myID' ); if( !oH ) { return false; }
- var oW = oH.clip ? oH.clip.width : oH.offsetWidth;
- var oH = oH.clip ? oH.clip.height : oH.offsetHeight; if( !oH ) { return false; }
- if( !oH || window.doneAlready ) { return false; } //in case images are disabled
- window.doneAlready = true; //for Safari and Opera
- /*//no idea why this is in here
- if(document.getElementsByTagName) {
- for( var l = document.getElementsByTagName(\'a\'), x = 0; l[x]; x++ ) {
- if(l[x].className==\'makeright\'&&!l[x].style.position){
- l[x].style.position=\'relative\';
- l[x].style.left=(document.images[0].width-(l[x].offsetWidth+l[x].offsetLeft))+\'px\';
- }}}
- */
- var x = window; x.resizeTo( oW + 200, oH + 200 );
- var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
- if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
- else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
- else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
- if( window.opera && !document.childNodes ) { myW += 16; }
- x.resizeTo( oW = oW + ( ( oW + 200 ) - myW ), oH = oH + ( (oH + 200 ) - myH ) );
- //three lines to center the popup on the screen
- //'var scW = screen.availWidth ? screen.availWidth : screen.width;
- //'var scH = screen.availHeight ? screen.availHeight : screen.height;
- //'if( !window.opera ) { x.moveTo(Math.round((scW-oW)/2),Math.round((scH-oH)/2)); }
- return false;
-}
-
-
-//open popup with image and text
-function openPerfectPopup(oSrc, oWidth, oTitle, oText){
-
- //the first two should be small for Opera's sake
- PositionX = 20;
- PositionY = 20;
- defaultWidth = 600;
- defaultHeight = 400;
- var AutoClose = '';
- var oW1 = oWidth+30;
- var oContent
-
- var buttonclose = " ";
-
- oContent = "
\n";
- oContent += "";
- oContent += " ";
- oContent += " \n";
- oContent += ""+oText+" \n";
- oContent += ""+buttonclose+" \n";
- oContent += "
\n";
-
- var imgWin = window.open('','name','scrollbars=no,resizable=1,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY);
- if( !imgWin ) { return true; } //popup blockers should not cause errors
- imgWin.document.write('\n'+
- '\n'+
- ''+oTitle+'<\/title>\n'+
- '\n";
- // }
- // on the page where you want to popup image to appear,
- // you need to include this class and create a new object for it:
- // require_once(e_HANDLER."popup_handler.php");
- // $pp = new popup;
- // then you need to prepare the right paramater in the function call.
- // the function returns the image with the popup link as a href on it
- // clicking the popup will use the js functions in the included js file to popup the image
- // $pp -> popup($oSrc, $oSrcThumb, $oIconWidth, $oMaxWidth, $oTitle, $oText)
-
- function popup($image, $thumb, $iconwidth='100', $maxwidth='', $title, $text){
- global $tp;
- //$image : full path to the large image you want to popup
- //$thumb : full path to the small image to show on screen
- //$maxwidth : the maximum size (width or height) an image may be popup'ed
- //$title : the window title of the popup
- //$text : the additional text to add into the popup
-
- if(file_exists($image)){
-
- //use $image if $thumb doesn't exist
- if(!file_exists($thumb)){
- $thumb = $image;
- }
- $imagearray = getimagesize(trim($image));
- //$imagearray holds width and height parameters of the image
- //$imagearray[0] is width - $imagearray[1] is height
-
- if($imagearray[1] > $imagearray[0]){
- if(isset($maxwidth) && $maxwidth!='' && $imagearray[1] > $maxwidth){
- $width = round(($maxwidth*$imagearray[0])/$imagearray[1],0);
- $height = $maxwidth;
- }else{
- $width = $imagearray[0];
- $height = $imagearray[1];
- }
- }else{
- if(isset($maxwidth) && $maxwidth!='' && $imagearray[0] > $maxwidth){
- $width = $maxwidth;
- $height = round(($maxwidth*$imagearray[1])/$imagearray[0],0);
- }else{
- $width = $imagearray[0];
- $height = $imagearray[1];
- }
- }
- $iconwidth = ($title == "help" ? "" : ($iconwidth ? "width:".intval($iconwidth)."px;" : "width:100px;") );
-
- $width = intval($width);
- $search = array("'", '$', '"', '$',''', '\');
- $replace = array("\'", '\$', '"', '\$', "\'", '\\');
- $title = str_replace($search, $replace, $title);
- $text = str_replace($search, $replace, $text);
-
- $popup = " ";
-
- }else{
- $popup = "";
- }
- return $popup;
- }
-}
-
-?>
\ No newline at end of file
diff --git a/e107_handlers/user_extended_class.php b/e107_handlers/user_extended_class.php
index 2be3b1055..7969a160a 100644
--- a/e107_handlers/user_extended_class.php
+++ b/e107_handlers/user_extended_class.php
@@ -694,16 +694,7 @@ class e107_user_extended
break;
case EUF_DATE : //date
- return $cal->make_input_field(
- array(
- 'ifFormat' => '%Y-%m-%d'
- ),
- array(
- 'class' => 'tbox',
- 'name' => $fname,
- 'value' => $curval
- )
- );
+ return e107::getForm()->datepicker($fname,$curval,'dateformat=yy-mm-dd');
break;
case EUF_LANGUAGE : // language
diff --git a/e107_plugins/download/admin_download.php b/e107_plugins/download/admin_download.php
index 25227eb92..7643a746d 100644
--- a/e107_plugins/download/admin_download.php
+++ b/e107_plugins/download/admin_download.php
@@ -33,13 +33,13 @@ require_once(e_HANDLER.'xml_class.php');
require_once(e_HANDLER."form_handler.php");
require_once(e_HANDLER."ren_help.php");
require_once(e_HANDLER."calendar/calendar_class.php");
-$cal = new DHTML_Calendar(true);
-$gen = new convert();
+//$cal = new DHTML_Calendar(true);
+//$gen = new convert();
function headerjs()
{
- global $cal;
- return $cal->load_files()."\n";
+ // global $cal;
+// return $cal->load_files()."\n";
}
$e_sub_cat = 'download';
diff --git a/e107_plugins/download/includes/admin.php b/e107_plugins/download/includes/admin.php
index 5ddcca02a..2edea2ca5 100644
--- a/e107_plugins/download/includes/admin.php
+++ b/e107_plugins/download/includes/admin.php
@@ -861,18 +861,13 @@ $columnInfo = array(
if (!$download_datestamp){
$download_datestamp = time();
}
- $cal_options['showsTime'] = false;
- $cal_options['showOthers'] = false;
- $cal_options['weekNumbers'] = false;
- $cal_options['ifFormat'] = "%d/%m/%Y %H:%M:%S";
- $cal_options['timeFormat'] = "24";
- $cal_attrib['class'] = "tbox";
- $cal_attrib['size'] = "22";
- $cal_attrib['name'] = "download_datestamp";
- $cal_attrib['value'] = date("d/m/Y H:i:s", $download_datestamp);
- $text .= $cal->make_input_field($cal_options, $cal_attrib);
- $update_checked = ($_POST['update_datestamp']) ? "checked='checked'" : "";
- $text .= " ".DOWLAN_148."
+
+ $text .= $frm->datepicker('download_datestamp',$download_datestamp);
+
+ // $update_checked = ($_POST['update_datestamp']) ? "checked='checked'" : "";
+ // $text .= " ".DOWLAN_148." ";
+
+ $text .= "
@@ -1086,27 +1081,20 @@ $columnInfo = array(
// ------------------------------------------
- $dlInfo['download_description'] = $tp->toDB($_POST['download_description']);
- $dlInfo['download_name'] = $tp->toDB($_POST['download_name']);
- $dlInfo['download_author'] = $tp->toDB($_POST['download_author']);
- $dlInfo['download_author_email'] = $tp->toDB($_POST['download_author_email']);
- $dlInfo['download_author_website'] = $tp->toDB($_POST['download_author_website']);
- $dlInfo['download_category'] = intval($_POST['download_category']);
- $dlInfo['download_active'] = intval($_POST['download_active']);
- $dlInfo['download_thumb'] = $tp->toDB($_POST['download_thumb']);
- $dlInfo['download_image'] = $tp->toDB($_POST['download_image']);
- $dlInfo['download_comment'] = $tp->toDB($_POST['download_comment']);
- $dlInfo['download_class'] = intval($_POST['download_class']);
- $dlInfo['download_visible'] = intval($_POST['download_visible']);
-
- if(preg_match("#(.*?)/(.*?)/(.*?) (.*?):(.*?):(.*?)$#", $_POST['download_datestamp'], $matches))
- {
- $dlInfo['download_datestamp'] = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]);
- }
- else
- {
- $dlInfo['download_datestamp'] = time();
- }
+ $dlInfo['download_description'] = $tp->toDB($_POST['download_description']);
+ $dlInfo['download_name'] = $tp->toDB($_POST['download_name']);
+ $dlInfo['download_author'] = $tp->toDB($_POST['download_author']);
+ $dlInfo['download_author_email'] = $tp->toDB($_POST['download_author_email']);
+ $dlInfo['download_author_website'] = $tp->toDB($_POST['download_author_website']);
+ $dlInfo['download_category'] = intval($_POST['download_category']);
+ $dlInfo['download_active'] = intval($_POST['download_active']);
+ $dlInfo['download_thumb'] = $tp->toDB($_POST['download_thumb']);
+ $dlInfo['download_image'] = $tp->toDB($_POST['download_image']);
+ $dlInfo['download_comment'] = $tp->toDB($_POST['download_comment']);
+ $dlInfo['download_class'] = intval($_POST['download_class']);
+ $dlInfo['download_visible'] = intval($_POST['download_visible']);
+ $dlInfo['download_datestamp'] = e107::getDate()->convert($_POST['download_datestamp'],'inputdate');
+
if($_POST['update_datestamp'])
{
diff --git a/usersettings.php b/usersettings.php
index 3451cdd88..cfd21d7fe 100644
--- a/usersettings.php
+++ b/usersettings.php
@@ -59,9 +59,6 @@ require_once (e_HANDLER.'ren_help.php');
include_once (e107::coreTemplatePath('usersettings')); //correct way to load a core template.
include_once (e_CORE.'shortcodes/batch/usersettings_shortcodes.php');
-require_once (e_HANDLER.'calendar/calendar_class.php');
-$cal = new DHTML_Calendar(true);
-
// include JS, headerjs not called in header anymore
$js = e107::getJs();
$js->footerInline(headerjs());
@@ -748,7 +745,7 @@ function delete_file($fname, $dir = 'avatars/')
function headerjs()
{
- //global $cal;
+
$script = "
";
- //$script .= $cal->load_files();
+
return $script;
}