]> git.mxchange.org Git - friendica.git/commitdiff
frio: events - work on event_form.tpl + datetime.php
authorrabuzarus <>
Mon, 13 Jun 2016 08:19:38 +0000 (10:19 +0200)
committerrabuzarus <>
Mon, 13 Jun 2016 08:19:38 +0000 (10:19 +0200)
include/datetime.php
mod/events.php
view/theme/frio/templates/event_form.tpl
view/theme/frio/templates/events-js.tpl

index 89305a2406f1238375944c436ec2e0f21522f126..bbb60ba72cd528ee2a8b3f5f5880849cb0b23b04 100644 (file)
@@ -202,7 +202,7 @@ function dob($dob) {
  * @return string Parsed HTML output.
  */
 function datesel($format, $min, $max, $default, $id = 'datepicker') {
-       return datetimesel($format,$min,$max,$default,$id,true,false, '','');
+       return datetimesel($format,$min,$max,$default,'',$id,true,false, '','');
 }
 
 /**
@@ -220,7 +220,7 @@ function datesel($format, $min, $max, $default, $id = 'datepicker') {
  * @return string Parsed HTML output.
  */
 function timesel($format, $h, $m, $id='timepicker') {
-       return datetimesel($format,new DateTime(),new DateTime(),new DateTime("$h:$m"),$id,false,true);
+       return datetimesel($format,new DateTime(),new DateTime(),new DateTime("$h:$m"),'',$id,false,true);
 }
 
 /**
@@ -251,7 +251,7 @@ function timesel($format, $h, $m, $id='timepicker') {
  * @todo Once browser support is better this could probably be replaced with
  * native HTML5 date picker.
  */
-function datetimesel($format, $min, $max, $default, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false) {
+function datetimesel($format, $min, $max, $default, $label, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false) {
 
        // First day of the week (0 = Sunday)
        $firstDay = get_pconfig(local_user(),'system','first_day_of_week');
@@ -283,9 +283,9 @@ function datetimesel($format, $min, $max, $default, $id = 'datetimepicker', $pic
        $extra_js = '';
        $pickers .= ",dayOfWeekStart: ".$firstDay.",lang:'".$lang."'";
        if($minfrom != '')
-               $extra_js .= "\$('#$minfrom').data('xdsoft_datetimepicker').setOptions({onChangeDateTime: function (currentDateTime) { \$('#$id').data('xdsoft_datetimepicker').setOptions({minDate: currentDateTime})}})";
+               $extra_js .= "\$('id_#$minfrom').data('xdsoft_datetimepicker').setOptions({onChangeDateTime: function (currentDateTime) { \$('#id_$id').data('xdsoft_datetimepicker').setOptions({minDate: currentDateTime})}})";
        if($maxfrom != '')
-               $extra_js .= "\$('#$maxfrom').data('xdsoft_datetimepicker').setOptions({onChangeDateTime: function (currentDateTime) { \$('#$id').data('xdsoft_datetimepicker').setOptions({maxDate: currentDateTime})}})";
+               $extra_js .= "\$('#id_$maxfrom').data('xdsoft_datetimepicker').setOptions({onChangeDateTime: function (currentDateTime) { \$('#id_$id').data('xdsoft_datetimepicker').setOptions({maxDate: currentDateTime})}})";
 
        $readable_format = $dateformat;
        $readable_format = str_replace('Y','yyyy',$readable_format);
@@ -294,10 +294,14 @@ function datetimesel($format, $min, $max, $default, $id = 'datetimepicker', $pic
        $readable_format = str_replace('H','HH',$readable_format);
        $readable_format = str_replace('i','MM',$readable_format);
 
-       $o .= "<div class='date'><input type='text' placeholder='$readable_format' name='$id' id='$id' $input_text />";
-       $o .= '</div>';
+       $tpl = get_markup_template('field_input.tpl');
+       $o .= replace_macros($tpl,array(
+                       '$field' => array($id, $label, $input_text, '', (($required) ? '*' : ''), 'placeholder="' . $readable_format . '" '),
+               ));
+//     $o .= "<div class='date'><input type='text' placeholder='$readable_format' name='$id' id='$id' $input_text />";
+//     $o .= '</div>';
        $o .= "<script type='text/javascript'>";
-       $o .= "\$(function () {var picker = \$('#$id').datetimepicker({step:5,format:'$dateformat' $minjs $maxjs $pickers $defaultdatejs}); $extra_js})";
+       $o .= "\$(function () {var picker = \$('#id_$id').datetimepicker({step:5,format:'$dateformat' $minjs $maxjs $pickers $defaultdatejs}); $extra_js})";
        $o .= "</script>";
 
        return $o;
index 46f33355b9c850cdc91af1e08a053623f20ff2e2..f6872a61629fdc9e5a9201ad50097f05e2338da2 100644 (file)
@@ -561,11 +561,11 @@ function events_content(&$a) {
                        '$title' => t('Event details'),
                        '$desc' => t('Starting date and Title are required.'),
                        '$s_text' => t('Event Starts:') . ' <span class="required" title="' . t('Required') . '">*</span>',
-                       '$s_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$syear+5),DateTime::createFromFormat('Y-m-d H:i',"$syear-$smonth-$sday $shour:$sminute"),'start_text',true,true,'','',true),
+                       '$s_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$syear+5),DateTime::createFromFormat('Y-m-d H:i',"$syear-$smonth-$sday $shour:$sminute"),t('Event Starts:'),'start_text',true,true,'','',true),
                        '$n_text' => t('Finish date/time is not known or not relevant'),
                        '$n_checked' => $n_checked,
                        '$f_text' => t('Event Finishes:'),
-                       '$f_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$fyear+5),DateTime::createFromFormat('Y-m-d H:i',"$fyear-$fmonth-$fday $fhour:$fminute"),'finish_text',true,true,'start_text'),
+                       '$f_dsel' => datetimesel($f,new DateTime(),DateTime::createFromFormat('Y',$fyear+5),DateTime::createFromFormat('Y-m-d H:i',"$fyear-$fmonth-$fday $fhour:$fminute"),t('Event Finishes:'),'finish_text',true,true,'start_text'),
                        '$a_text' => t('Adjust for viewer timezone'),
                        '$a_checked' => $a_checked,
                        '$d_text' => t('Description:'),
@@ -574,8 +574,11 @@ function events_content(&$a) {
                        '$l_orig' => $l_orig,
                        '$t_text' => t('Title:') . ' <span class="required" title="' . t('Required') . '">*</span>',
                        '$t_orig' => $t_orig,
+                       '$summary' => array('summary', t('Title:'), $t_orig, '', '*'),
                        '$sh_text' => t('Share this event'),
                        '$sh_checked' => $sh_checked,
+                       '$nofinish' => array('nofinish', t('Finish date/time is not known or not relevant'), $n_checked),
+                       '$adjust' => array('adjust', t('Adjust for viewer timezone'), $a_checked),
                        '$preview' => t('Preview'),
                        '$acl' => $acl,
                        '$submit' => t('Submit')
index ff59833b55eb2819678d6e9a60b51ceba3ddc308..ebe4faa3573dc1c41e16d76e4b13e5c8af7f46bb 100644 (file)
 <input type="hidden" name="uri" value="{{$uri}}" />
 <input type="hidden" name="preview" id="event-edit-preview" value="0" />
 
-<div id="event-start-text">{{$s_text}}</div>
 {{$s_dsel}}
 
-<div id="event-finish-text">{{$f_text}}</div>
 {{$f_dsel}}
 
-<div id="event-datetime-break"></div>
-
-<input type="checkbox" name="nofinish" value="1" id="event-nofinish-checkbox" {{$n_checked}} /> <div id="event-nofinish-text">{{$n_text}}</div>
-
-<div id="event-nofinish-break"></div>
-
-<input type="checkbox" name="adjust" value="1" id="event-adjust-checkbox" {{$a_checked}} /> <div id="event-adjust-text">{{$a_text}}</div>
-
-<div id="event-adjust-break"></div>
-
-<div id="event-summary-text">{{$t_text}}</div>
-<input type="text" id="event-summary" name="summary" value="{{$t_orig|escape:'html'}}" />
-
-
-<div id="event-desc-text">{{$d_text}}</div>
-<textarea id="event-desc-textarea" name="desc">{{$d_orig}}</textarea>
+{{include file="field_checkbox.tpl" field=$nofinish}}
+
+{{include file="field_checkbox.tpl" field=$adjust}}
+
+{{include file="field_input.tpl" field=$summary}}
+
+<div class="form-group">
+       <div id="event-desc-text"><b>{{$d_text}}</b></div>
+       <textarea id="comment-edit-text-desc" class="form-control" name="desc" >{{$d_orig}}</textarea>
+       <ul id="event-desc-text-edit-bb" class="comment-edit-bb comment-icon-list nav nav-pills hidden-xs pull-left">
+               <li>
+                       <a class="icon" style="cursor: pointer;" title="{{$edimg|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="img" data-id="desc">
+                               <i class="fa fa-picture-o"></i>
+                       </a>
+               </li>
+               <li>
+                       <a class="icon bb-url" style="cursor: pointer;" title="{{$edurl|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="url" data-id="desc">
+                               <i class="fa fa-link"></i>
+                       </a>
+               </li>
+               <li>
+                       <a class="icon bb-video" style="cursor: pointer;" title="{{$edvideo|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="video" data-id="desc">
+                               <i class="fa fa-video-camera"></i>
+                       </a>
+               </li>
+
+               <li>
+                       <a class="icon underline" style="cursor: pointer;" title="{{$eduline|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="u" data-id="desc">
+                               <i class="fa fa-underline"></i>
+                       </a>
+               </li>
+               <li>
+                       <a class="icon italic" style="cursor: pointer;" title="{{$editalic|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="i" data-id="desc">
+                               <i class="fa fa-italic"></i>
+                       </a>
+               </li>
+               <li>
+                       <a class="icon bold" style="cursor: pointer;"  title="{{$edbold|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="b" data-id="desc">
+                               <i class="fa fa-bold"></i>
+                       </a>
+               </li>
+               <li>
+                       <a class="icon quote" style="cursor: pointer;" title="{{$edquote|escape:'html'}}" data-role="insert-formatting" data-comment=" " data-bbcode="quote" data-id="desc">
+                               <i class="fa fa-quote-left"></i>
+                       </a>
+               </li>
+       </ul>
+       <div class="clear"></div>
+</div>
 
 
 <div id="event-location-text">{{$l_text}}</div>
index dcd522c5869547b50d89c4ec97a9e3cdf7a4647a..93c131b36bd539f245f8cce668f1ac41a348e0ea 100644 (file)
@@ -1,7 +1,7 @@
 <div class="generic-page-wrapper">
        {{$tabs}}
        {{include file="section_title.tpl" title=$title}}
-
+<div id="new-event-link"><a href="{{$new_event.0}}" >{{$new_event.1}}</a></div>
        <div id="new-event-link"><a onclick="addToModal('{{$new_event.0}}')" >{{$new_event.1}}</a></div>
 
        <div id="fc-header">