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