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