Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Functions

  • frontendusers_groupselect_canonicalVariables
  • frontendusers_groupselect_display
  • frontendusers_groupselect_getTitle
  • frontendusers_groupselect_getvalue
  • frontendusers_groupselect_store
  • frontendusers_groupselect_wantedVariables
  • frontendusers_valid_from_display
  • frontendusers_valid_from_getTitle
  • frontendusers_valid_from_store
  • frontendusers_valid_from_wantedVariables
  • frontendusers_valid_to_display
  • frontendusers_valid_to_getTitle
  • frontendusers_valid_to_store
  • frontendusers_valid_to_wantedVariables
  • Overview
  • Package
  • Function
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: /**
 3:  * This file contains the valid_from extension of the frontend user plugin.
 4:  *
 5:  * @package    Plugin
 6:  * @subpackage FrontendUsers
 7:  * @version    SVN Revision $Rev:$
 8:  *
 9:  * @author     Timo Trautmann
10:  * @copyright  four for business AG <www.4fb.de>
11:  * @license    http://www.contenido.org/license/LIZENZ.txt
12:  * @link       http://www.4fb.de
13:  * @link       http://www.contenido.org
14:  */
15: 
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17: 
18: function frontendusers_valid_from_getTitle() {
19:     return i18n("Valid from");
20: }
21: 
22: function frontendusers_valid_from_display() {
23:     global $feuser, $db, $belang, $cfg;
24: 
25:     $langscripts = '';
26: 
27:     if (($lang_short = substr(strtolower($belang), 0, 2)) != "en") {
28:         $langscripts = '<script type="text/javascript" src="scripts/jquery/plugins/timepicker-' . $lang_short . '.js"></script>
29:         <script type="text/javascript" src="scripts/jquery/plugins/datepicker-' . $lang_short . '.js"></script>';
30:     }
31: 
32:     $path_to_calender_pic = cRegistry::getBackendUrl() . $cfg['path']['images'] . 'calendar.gif';
33: 
34:     $template = '%s';
35: 
36:     $currentValue = $feuser->get("valid_from");
37: 
38:     if ($currentValue == '') {
39:         $currentValue = '0000-00-00';
40:     }
41:     $currentValue = str_replace('00:00:00', '', $currentValue);
42: 
43:     $sValidFrom = '
44:         <link rel="stylesheet" type="text/css" href="styles/jquery/plugins/timepicker.css">
45:         <link rel="stylesheet" type="text/css" href="styles/jquery/jquery-ui.css">
46: {_JS_HEAD_CONTENIDO_}
47:         <script type="text/javascript" src="scripts/jquery/plugins/timepicker.js"></script>';
48:     $sValidFrom .= $langscripts;
49: 
50:     $sValidFrom .= '<input type="text" id="valid_from" name="valid_from" value="' . $currentValue . '">';
51:     $sValidFrom .= '<script type="text/javascript">
52: (function(Con, $) {
53:     $(function() {
54:         $("#valid_from").datetimepicker({
55:             buttonImage:"' . $path_to_calender_pic . '",
56:             buttonImageOnly: true,
57:             showOn: "both",
58:             dateFormat: "yy-mm-dd",
59:             onClose: function(dateText, inst) {
60:                 var endDateTextBox = $("#valid_to");
61:                 if (endDateTextBox.val() != "") {
62:                     var testStartDate = new Date(dateText);
63:                     var testEndDate = new Date(endDateTextBox.val());
64:                     if (testStartDate > testEndDate) {
65:                         endDateTextBox.val(dateText);
66:                     }
67:                 } else {
68:                     endDateTextBox.val(dateText);
69:                 }
70:             },
71:             onSelect: function(selectedDateTime) {
72:                 var start = $(this).datetimepicker("getDate");
73:                 $("#valid_to").datetimepicker("option", "minDate", new Date(start.getTime()));
74:             }
75:         });
76:     });
77: })(Con, Con.$);
78: </script>';
79: 
80:     $template = sprintf($template, $sValidFrom);
81:     $oTemplate = new cTemplate();
82:     return $oTemplate->generate($template, 1);
83: }
84: 
85: function frontendusers_valid_from_wantedVariables() {
86:     return (array("valid_from"));
87: }
88: 
89: function frontendusers_valid_from_store($variables) {
90:     global $feuser;
91: 
92:     $feuser->set("valid_from", $variables["valid_from"], false);
93: }
94: 
95: ?>
96: 
CMS CONTENIDO 4.9.5 API documentation generated by ApiGen 2.8.0