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