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