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_to 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_to_getTitle ()
19: {
20:     return i18n("Valid to");
21: }
22: 
23: function frontendusers_valid_to_display ()
24: {
25:     global $feuser,$db,$belang,$cfg;
26: 
27:     $langscripts = '';
28: 
29: 
30:     $path_to_calender_pic =  cRegistry::getBackendUrl() . $cfg['path']['images'] . 'calendar.gif';
31: 
32:     $template  = '%s';
33: 
34:     $currentValue = $feuser->get("valid_to");
35: 
36:     if ($currentValue == '') {
37:         $currentValue = '0000-00-00';
38:     }
39:     $currentValue = str_replace('00:00:00', '', $currentValue);
40: 
41:     // js-includes are defined in valid_from
42:     $sValidFrom = '<input type="text" id="valid_to" name="valid_to" value="'.$currentValue.'">';
43:     $sValidFrom .= '<script type="text/javascript">
44: (function(Con, $) {
45:         $(function() {
46:     $("#valid_to").datetimepicker({
47:         buttonImage: "'. $path_to_calender_pic .'",
48:         buttonImageOnly: true,
49:         showOn: "both",
50:         dateFormat: "yy-mm-dd",
51:         onClose: function(dateText, inst) {
52:             var startDateTextBox = $("#valid_from");
53:             if (startDateTextBox.val() != "") {
54:                 var testStartDate = new Date(startDateTextBox.val());
55:                 var testEndDate = new Date(dateText);
56:                 if (testStartDate > testEndDate) {
57:                     startDateTextBox.val(dateText);
58:                 }
59:             } else {
60:                 startDateTextBox.val(dateText);
61:             }
62:         },
63:         onSelect: function(selectedDateTime) {
64:             var end = $(this).datetimepicker("getDate");
65:             $("#valid_from").datetimepicker("option", "maxDate", new Date(end.getTime()));
66:         }
67:     });
68:             });
69: })(Con, Con.$);
70: </script>';
71: 
72:     return sprintf($template,$sValidFrom);
73: }
74: 
75: function frontendusers_valid_to_wantedVariables()
76: {
77:     return (array("valid_to"));
78: }
79: 
80: function frontendusers_valid_to_store($variables)
81: {
82:     global $feuser;
83: 
84:     $feuser->set("valid_to", $variables["valid_to"], false);
85: }
86: ?>
87: 
CMS CONTENIDO 4.9.5 API documentation generated by ApiGen 2.8.0