Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SIWECOS
    • 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_to extension of the frontend user plugin.
 4:  *
 5:  * @package    Plugin
 6:  * @subpackage FrontendUsers
 7:  * @author     Timo Trautmann
 8:  * @copyright  four for business AG <www.4fb.de>
 9:  * @license    http://www.contenido.org/license/LIZENZ.txt
10:  * @link       http://www.4fb.de
11:  * @link       http://www.contenido.org
12:  */
13: 
14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
15: 
16: /**
17:  * @return string
18:  */
19: function frontendusers_valid_to_getTitle ()
20: {
21:     return i18n("Valid to");
22: }
23: 
24: /**
25:  * @return string
26:  */
27: function frontendusers_valid_to_display ()
28: {
29:     global $feuser,$db,$belang,$cfg;
30: 
31:     $langscripts = '';
32: 
33:     $path_to_calender_pic =  cRegistry::getBackendUrl() . $cfg['path']['images'] . 'calendar.gif';
34: 
35:     $template  = '%s';
36: 
37:     $currentValue = $feuser->get("valid_to");
38: 
39:     if ($currentValue == '') {
40:         $currentValue = '0000-00-00';
41:     }
42:     $currentValue = str_replace('00:00:00', '', $currentValue);
43: 
44:     // js-includes are defined in valid_from
45:     $sValidFrom = '<input type="text" id="valid_to" name="valid_to" value="'.$currentValue.'">';
46:     $sValidFrom .= '<script type="text/javascript">
47: (function(Con, $) {
48:         $(function() {
49:     $("#valid_to").datetimepicker({
50:         buttonImage: "'. $path_to_calender_pic .'",
51:         buttonImageOnly: true,
52:         showOn: "both",
53:         dateFormat: "yy-mm-dd",
54:         onClose: function(dateText, inst) {
55:             var startDateTextBox = $("#valid_from");
56:             if (startDateTextBox.val() != "") {
57:                 var testStartDate = new Date(startDateTextBox.val());
58:                 var testEndDate = new Date(dateText);
59:                 if (testStartDate > testEndDate) {
60:                     startDateTextBox.val(dateText);
61:                 }
62:             } else {
63:                 startDateTextBox.val(dateText);
64:             }
65:         },
66:         onSelect: function(selectedDateTime) {
67:             var end = $(this).datetimepicker("getDate");
68:             $("#valid_from").datetimepicker("option", "maxDate", new Date(end.getTime()));
69:         }
70:     });
71:             });
72: })(Con, Con.$);
73: </script>';
74: 
75:     return sprintf($template,$sValidFrom);
76: }
77: 
78: /**
79:  * @return array
80:  */
81: function frontendusers_valid_to_wantedVariables()
82: {
83:     return (array("valid_to"));
84: }
85: 
86: /**
87:  * @param $variables
88:  */
89: function frontendusers_valid_to_store($variables)
90: {
91:     global $feuser;
92: 
93:     $feuser->set("valid_to", $variables["valid_to"], false);
94: }
95: 
96: ?>
CMS CONTENIDO 4.10.1 API documentation generated by ApiGen 2.8.0