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
    • NavigationMain
    • 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: {
20:     return i18n("Valid from");
21: }
22: 
23: function frontendusers_valid_from_display()
24: {
25:     global $feuser,$db,$belang,$cfg;
26: 
27:     $langscripts = '';
28: 
29:     if (($lang_short = substr(strtolower($belang), 0, 2)) != "en") {
30:         $langscripts=  '<script type="text/javascript" src="scripts/jquery/plugins/timepicker-'.$lang_short.'.js"></script>
31:         <script type="text/javascript" src="scripts/jquery/plugins/datepicker-'.$lang_short.'.js"></script>';
32:     }
33: 
34:     $path_to_calender_pic = cRegistry::getBackendUrl() . $cfg['path']['images'] . 'calendar.gif';
35: 
36:     $template  = '%s';
37: 
38:     $currentValue = $feuser->get("valid_from");
39: 
40:     if ($currentValue == '') {
41:         $currentValue = '0000-00-00';
42:     }
43:     $currentValue = str_replace('00:00:00', '', $currentValue);
44: 
45:     $sValidFrom = ' <link rel="stylesheet" type="text/css" href="styles/jquery/plugins/timepicker.css">
46:                     <link rel="stylesheet" type="text/css" href="styles/jquery/jquery-ui.css">
47:                     <script type="text/javascript" src="scripts/jquery/jquery.js"></script>
48:                     <script type="text/javascript" src="scripts/jquery/jquery-ui.js"></script>
49:                     <script type="text/javascript" src="scripts/jquery/plugins/timepicker.js"></script>';
50:     $sValidFrom .= $langscripts;
51: 
52:     $sValidFrom .= '<input type="text" id="valid_from" name="valid_from" value="'.$currentValue.'">';
53:     $sValidFrom .= '<script type="text/javascript">
54: 
55:      $(document).ready(function() {
56:     $("#valid_from").datetimepicker({
57:              buttonImage:"'. $path_to_calender_pic.'",
58:               buttonImageOnly: true,
59:               showOn: "both",
60:               dateFormat: "yy-mm-dd",
61:             onClose: function(dateText, inst) {
62:                 var endDateTextBox = $("#valid_to");
63:                 if (endDateTextBox.val() != "") {
64:                     var testStartDate = new Date(dateText);
65:                     var testEndDate = new Date(endDateTextBox.val());
66:                     if (testStartDate > testEndDate)
67:                         endDateTextBox.val(dateText);
68:                 }
69:                 else {
70:                     endDateTextBox.val(dateText);
71:                 }
72:             },
73:             onSelect: function (selectedDateTime) {
74:                 var start = $(this).datetimepicker("getDate");
75:                 $("#valid_to").datetimepicker("option", "minDate", new Date(start.getTime()));
76:             }
77:         });
78: 
79: });
80: </script>';
81: 
82:     return sprintf($template,$sValidFrom);
83: }
84: 
85: function frontendusers_valid_from_wantedVariables ()
86: {
87:     return (array("valid_from"));
88: }
89: 
90: function frontendusers_valid_from_store ($variables)
91: {
92:     global $feuser;
93: 
94:     $feuser->set("valid_from", $variables["valid_from"], false);
95: }
96: ?>
97: 
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0