-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathdefault.php
More file actions
176 lines (166 loc) · 7.31 KB
/
Copy pathdefault.php
File metadata and controls
176 lines (166 loc) · 7.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
/**
* @version SEBLOD 3.x Core ~ $Id: default.php sebastienheraud $
* @package SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder)
* @url https://www.seblod.com
* @editor Octopoos - www.octopoos.com
* @copyright Copyright (C) 2009 - 2017 SEBLOD. All Rights Reserved.
* @license GNU General Public License version 2 or later; see _LICENSE.php
**/
defined( '_JEXEC' ) or die;
if ( ( JCck::getConfig_Param( 'validation', 2 ) > 1 ) && $this->config['validation'] != '' ) {
Helper_Include::addValidation( $this->config['validation'], $this->config['validation_options'] );
$js = 'if (jQuery("#'.$this->form_id.'").validationEngine("validate",task) === true) { JCck.Core.submitForm((task=="save"?"search":task), document.getElementById("'.$this->form_id.'")); }';
} else {
$js = 'JCck.Core.submitForm((task=="save"?"search":task), document.getElementById("'.$this->form_id.'"));';
}
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$id = str_replace( ' ', '_', trim( $this->pageclass_sfx ) );
$id = ( $id ) ? 'id="'.$id.'" ' : '';
?>
<?php if ( $this->show_form ) {
$js = $this->config['submit'].' = function(task) {'. $js.' };'
. 'Joomla.submitbutton = function(task, cid)'
. '{'
. 'if (task == "delete") {'
. 'if (!confirm(Joomla.JText._(\'COM_CCK_CONFIRM_DELETE\'))) {'
. 'return false;'
. '}'
. '}'
. 'jQuery("#'.$this->form_id.'").append(\'<input type="hidden" id="return" name="return" value="'.base64_encode( JUri::getInstance()->toString() ).'">\');'
. 'JCck.Core.submitForm(task,document.getElementById(\''.$this->form_id.'\'));'
. '};'
. '';
$doc->addScriptDeclaration( $js );
} ?>
<?php if ( !$this->raw_rendering ) { ?>
<div <?php echo $id; ?>class="cck_page cck-clrfix"><div>
<?php }
if ( $this->params->get( 'show_page_heading' ) ) {
echo '<h1>' . ( ( $this->escape( $this->params->get( 'page_heading' ) ) ) ? $this->escape( $this->params->get( 'page_heading' ) ) : $this->escape( $this->params->get( 'page_title' ) ) ) . '</h1>';
}
if ( $this->show_list_title ) {
$tag = $this->tag_list_title;
$class = trim( $this->class_list_title );
$class = $class ? ' class="'.$class.'"' : '';
echo '<'.$tag.$class.'>' . $this->title . '</'.$tag.'>';
}
if ( $this->show_list_desc == 1 && $this->description != '' ) {
echo ( $this->raw_rendering ) ? JHtml::_( 'content.prepare', $this->description ) : '<div class="cck_page_desc'.$this->pageclass_sfx.' cck-clrfix">' . JHtml::_( 'content.prepare', $this->description ) . '</div><div class="clr"></div>';
}
if ( $this->show_form ) {
if ( $this->show_form == 1 ) {
echo ( $this->config['action'] ) ? $this->config['action'] : '<form action="'.( ( $this->home ) ? JUri::base( true ) : JRoute::_( 'index.php?option='.$this->option ) ).'" autocomplete="off" method="get" id="'.$this->form_id.'" name="'.$this->form_id.'">';
if ( $this->raw_rendering ) {
echo $this->form.$this->loadTemplate( 'hidden' );
} else {
echo '<div class="cck_page_search'.$this->pageclass_sfx.' cck-clrfix">'.$this->form.$this->loadTemplate( 'hidden' ).'</div><div class="clr"></div>';
}
if ( !$this->form_wrapper ) {
echo '</form>';
}
} elseif ( $this->show_form == 2 && $this->form_wrapper ) {
echo ( $this->config['action'] ) ? $this->config['action'] : '<form action="'.( ( $this->home ) ? JUri::base( true ) : JRoute::_( 'index.php?option='.$this->option ) ).'" autocomplete="off" method="get" id="'.$this->form_id.'" name="'.$this->form_id.'">';
}
}
echo $this->loadTemplate( 'list' );
if ( $this->show_form ) {
if ( $this->show_form == 2 ) {
if ( !$this->form_wrapper ) {
echo ( $this->config['action'] ) ? $this->config['action'] : '<form action="'.( ( $this->home ) ? JUri::base( true ) : JRoute::_( 'index.php?option='.$this->option ) ).'" autocomplete="off" method="get" id="'.$this->form_id.'" name="'.$this->form_id.'">';
}
if ( $this->raw_rendering ) {
echo $this->form.$this->loadTemplate( 'hidden' );
} else {
echo '<div class="clr"></div><div class="cck_page_search'.$this->pageclass_sfx.'">'.$this->form.$this->loadTemplate( 'hidden' ).'</div>';
}
echo '</form>';
} elseif ( $this->show_form == 1 && $this->form_wrapper ) {
echo '</form>';
}
}
if ( $this->show_list_desc == 2 && $this->description != '' ) {
echo ( $this->raw_rendering ) ? JHtml::_( 'content.prepare', $this->description ) : '<div class="cck_page_desc'.$this->pageclass_sfx.' cck-clrfix">' . JHtml::_( 'content.prepare', $this->description ) . '</div><div class="clr"></div>';
}
?>
<?php if ( !$this->raw_rendering ) { ?>
</div></div>
<?php } ?>
<?php if ( $this->load_ajax ) {
$context = '&context={\'Itemid\':'.$app->input->getInt( 'Itemid', 0 ).',\'view\':\'list\'}';
$pre = '';
$url = JUri::current();
if ( $app->input->get( 'tmpl' ) == 'raw' ) {
$pre = '#seblod_form_raw ';
if ( $app->input->get( 'search' ) != '' ) {
$url = JCckDevHelper::getAbsoluteUrl( 'auto', 'view=list&search='.$app->input->get( 'search' ) );
}
}
?>
<script>
(function ($){
JCck.Core.loadmore = function(more,stop,search) {
var elem = "<?php echo $pre; ?>.cck-loading-more";
var search = search || 0;
$.ajax({
cache: false,
data: "format=raw&task=search&infinite=1<?php echo $context; ?>&return=<?php echo base64_encode( JUri::getInstance()->toString() ); ?>"+more,
type: "GET",
url: "<?php echo $url; ?>",
beforeSend:function(){ $("#seblod_form_load_more").hide(); $("#seblod_form_loading_more").show(); },
success: function(response){
if (stop != 1) {
$("#seblod_form_load_more").show()<?php echo ( $this->show_pagination == 8 ) ? '.click()' : ''; ?>;
} else {
$(".cck_page_list .pagination").hide();
}
$("#seblod_form_loading_more").hide();
if (search==1) { $(elem).html(response); } else { $(elem).append(response); }
<?php
if ( $this->callback_pagination != '' ) {
$pos = strpos( $this->callback_pagination, '$(' );
if ( $pos !== false && $pos == 0 ) {
echo $this->callback_pagination;
} else {
echo $this->callback_pagination.'(response);';
}
}
?>
},
error:function(){}
});
}
$(document).ready(function() {
$("#seblod_form_load_more").on("click", function() {
var start = parseInt($(this).attr("data-start"));
var step = parseInt($(this).attr("data-step"));
start = start+step;
var stop = (start+step>=parseInt($(this).attr("data-end"))) ? 1 : 0;
$(this).attr("data-start",start);
JCck.Core.loadmore("&start="+start,stop);
})<?php echo ( $this->show_pagination == 8 ) ? '.click()' : ''; ?>;
});
})(jQuery);
</script>
<?php } ?>
<?php if ( $this->load_resource ) {
$url = JRoute::_( 'index.php?Itemid='.$app->input->getInt( 'Itemid', 0 ) );
if ( $url == '/' ) {
$url = '';
}
$url = JUri::getInstance()->toString( array( 'scheme', 'host', 'port' ) ).$url;
?>
<script>
(function ($){
JCck.Core.loadfragment = JCck.Core.getModal(<?php echo $this->json_resource ? $this->json_resource : '{}'; ?>);
$(document).ready(function() {
var fragment = window.location.hash;
if (fragment != "") {
fragment = fragment.substring(1);
JCck.Core.loadfragment.loadRemote("<?php echo $url; ?>/"+fragment+"<?php echo ( $this->tmpl_resource ? '?tmpl='.$this->tmpl_resource : '' )?>");
}
});
})(jQuery);
</script>
<?php } ?>