Go to the documentation of this file.
8 require_once(CH_DIRECTORY_PATH_INC .
'design.inc.php');
9 require_once(CH_DIRECTORY_PATH_CLASSES .
'ChWsbSearch.php');
10 require_once(CH_DIRECTORY_PATH_CLASSES .
'ChWsbPaginate.php');
19 parent::__construct();
24 return isset($this->_isPermalinkEnabled) ? $this->_isPermalinkEnabled : ($this->_isPermalinkEnabled = (
getParam($this->aPermalinks[
'param']) ==
'on'));
29 $sLink = $this->aConstants[
'linksTempl'][
$sType];
30 $sLink = str_replace(
'{id}',
$iId, $sLink);
31 $sLink = str_replace(
'{uri}', $sUri, $sLink);
32 if (is_array($aOwner) && !
empty($aOwner)) {
33 $sLink = str_replace(
'{ownerName}', $aOwner[
'ownerName'], $sLink);
34 $sLink = str_replace(
'{ownerId}', $aOwner[
'ownerId'], $sLink);
36 return $GLOBALS[
'site'][
'url'] . $sLink;
43 if ($this->aCurrent[
'paginate'][
'totalNum'] > 0) {
45 foreach ($aData
as $aValue) {
48 $sCode =
'<div class="result_block">' .
$sCode .
'<div class="clear_both"></div></div>';
56 if (isset($this->aCurrent[
'rss']) && $this->aCurrent[
'rss'][
'link']) {
58 $sMenu =
ChWsbPageView::getBlockCaptionItemCode(
time(), array(
_t(
'RSS') => array(
'href' => $this->aCurrent[
'rss'][
'link'] . (
false === strpos($this->aCurrent[
'rss'][
'link'],
'?') ?
'?' :
'&') .
'rss=1',
'icon' =>
'rss')));
66 if (!isset(
$_GET[
'searchMode']))
67 $sCode =
'<div id="page_block_'.$this->id.
'">' .
$sCode .
'<div class="clear_both"></div></div>';
74 $sTempl = str_replace(
'{'.$sKey.
'}', $sValue, $sTempl);
76 $sCssHeader = strlen($sCssHeader) > 0 ? $sCssHeader :
'text_Unit';
77 $sTempl = str_replace(
'{unitClass}', $sCssHeader, $sTempl);
81 public static function showAdminActionsPanel($sWrapperId, $aButtons, $sCheckboxName =
'entry', $bSelectAll =
true, $bSelectAllChecked =
false, $sCustomHtml =
'')
84 foreach ($aButtons
as $k => $v) {
92 'value' =>
'_' == $v[0] ?
_t($v) : $v,
98 'ch_if:selectAll' => array(
99 'condition' => $bSelectAll,
101 'wrapperId' => $sWrapperId,
102 'checkboxName' => $sCheckboxName,
103 'checked' => ($bSelectAll && $bSelectAllChecked ?
'checked="checked"' :
'')
106 'ch_if:actionButtons' => array(
107 'condition' => !
empty($aBtns),
109 'class' => $sCustomHtml ?
'admin-actions-buttons-with-custom-html' :
'',
110 'ch_repeat:buttons' => $aBtns,
113 'ch_if:customHTML' => array(
114 'condition' => $sCustomHtml,
116 'custom_HTML' => $sCustomHtml,
121 return $GLOBALS[
'oSysTemplate']->parseHtmlByName(
'adminActionsPanel.html',
$aUnit, array(
'{',
'}'));
124 public static function showAdminFilterPanel($sFilterValue, $sInputId =
'filter_input_id', $sCheckboxId =
'filter_checkbox_id', $sFilterName =
'filter', $sOnApply =
'')
126 $sFilter =
_t(
'_sys_admin_filter');
127 $sApply =
_t(
'_sys_admin_apply');
130 $isChecked = $sFilterValue ?
' checked="checked" ' :
'';
133 $sOnApply =
"on_filter_apply(this, '" . $sInputId .
"', '" . $sFilterName .
"')";
140 <div
class=
"input_wrapper input_wrapper_text ch-def-round-corners-with-border">
141 <input
type=
"text" id=
"{$sInputId}" value=
"{$sFilterValue}" class=
"form_input_text ch-def-font" onkeypress=
"return on_filter_key_up(event, '{$sCheckboxId}')" />
144 <td><input
type=
"checkbox" id=
"{$sCheckboxId}" $isChecked onclick=
"{$sOnApply}" /></td>
145 <td><
label for=
"{$sCheckboxId}">{$sApply}</
label></td>
150 return $GLOBALS[
'oSysTemplate']->parseHtmlByName(
'designbox_top_controls.html', array(
157 $bChangePage = !isset($aParams[
'change_page']) || $aParams[
'change_page'] ===
true;
158 $bPageReload = !isset($aParams[
'page_reload']) || $aParams[
'page_reload'] ===
true;
164 foreach($aLinkAddon
as $sValue)
165 $sPageLink .= $sValue;
171 $sLoadDynamicUrl = $this->
id .
', \'searchKeywordContent.php?searchMode=ajax§ion[]=' . $this->aCurrent[
'name'] . $aLinkAddon[
'params'];
172 $sKeyword =
ch_get(
'keyword');
173 if ($sKeyword !==
false && mb_strlen($sKeyword) > 0)
174 $sLoadDynamicUrl .=
'&keyword=' . rawurlencode($sKeyword);
176 'page_url' => $sPageLink,
177 'count' => $this->aCurrent[
'paginate'][
'totalNum'],
178 'per_page' => $this->aCurrent[
'paginate'][
'perPage'],
179 'page' => $this->aCurrent[
'paginate'][
'page'],
180 'on_change_page' => !$bPageReload ?
'' :
'return !loadDynamicBlock(' . $sLoadDynamicUrl . $aLinkAddon[
'paginate'].
'\');
',
181 'on_change_per_page
' => !$bChangePage ? '' : 'return !loadDynamicBlock(
' . $sLoadDynamicUrl .'&page=1&per_page=\
' + this.value);',
183 return '<div class="clear_both"></div>' . $oPaginate->
getPaginate();
189 $aExclude[] =
'pageBlock';
190 $aExclude[] =
'searchMode';
191 $aExclude[] =
'section';
192 $aExclude[] =
'keyword';
194 $aCurrParams = array();
197 foreach ($this->aCurrent[
'restriction']
as $sKey => $aValue) {
198 if (isset($aValue[
'paramName'])) {
199 if (is_array($aValue[
'value']))
200 $aCurrParams[$aValue[
'paramName']] = $aValue[
'value'];
201 elseif (mb_strlen($aValue[
'value']) > 0)
202 $aCurrParams[$aValue[
'paramName']] = $aValue[
'value'];
207 foreach (
$_GET as $sKey => $sValue) {
208 if (!in_array($sKey, $aExclude))
209 $aParams[rawurlencode($sKey)] = rawurlencode($sValue);
211 $aParams = array_merge($aParams, $aCurrParams);
212 $aLinks = array(
'params'=>
'',
'paginate'=>
'');
213 foreach ($aParams
as $sKey => $sValue) {
214 if ($sKey !=
'page' && $sKey !=
'per_page')
215 $aLinks[
'params'] .=
'&'.$sKey.
'='.$sValue;
218 $aLinks[
'paginate'] .=
'&page={page}';
219 $aLinks[
'paginate'] .=
'&per_page={per_page}';
226 $this->aCurrent[
'sorting'] =
'last';
228 foreach ($this->aCurrent[
'restriction']
as $sKey => $aValue) {
229 if (!in_array($sKey, $aPassParams))
230 $this->aCurrent[
'restriction'][$sKey][
'value'] =
'';
233 $aPassJoins[] =
'profile';
235 foreach ($aPassJoins
as $sValue) {
236 if (isset($this->aCurrent[
'join'][$sValue]) && is_array($this->aCurrent[
'join'][$sValue]))
237 $aTemp[$sValue] = $this->aCurrent[
'join'][$sValue];
239 $this->aCurrent[
'join'] = $aTemp;
245 if (is_array($aParams)) {
246 foreach ($aParams
as $sKey => $mixedValue) {
247 if (isset($this->aCurrent[
'restriction'][$sKey]))
248 $this->aCurrent[
'restriction'][$sKey][
'value'] = $mixedValue;
259 if (strpos($sAllLinkType,
'http') ===
false) {
260 if (isset($this->aConstants[
'linksTempl'][$sAllLinkType]))
265 $sAllUrl = $sAllLinkType;
266 $sModeName = $this->aCurrent[
'name'] .
'_mode';
267 $sMode = isset(
$_GET[$sModeName]) ?
'&' . $sModeName .
'=' . rawurlencode(
$_GET[$sModeName]) : $sModeName .
'=' . $this->aCurrent[
'sorting'];
271 'page_url' => $sAllUrl,
272 'count' => $this->aCurrent[
'paginate'][
'totalNum'],
273 'per_page' => $this->aCurrent[
'paginate'][
'perPage'],
274 'page' => $this->aCurrent[
'paginate'][
'page'],
275 'on_change_page' =>
'return !loadDynamicBlock({id}, \'' . $sLink .
'?' .
$sMode . $aLinkAddon[
'params'] . $aLinkAddon[
'paginate'] .
'\');
',
276 'on_change_per_page
' => 'return !loadDynamicBlock({
id}, \
'' . $sLink .
'?' .
$sMode . $aLinkAddon[
'params'] .
'&page=1&per_page=\' + this.value);',
278 return $bPgnSim ? $oPaginate->getSimplePaginate($sAllUrl) : $oPaginate->getPaginate();
281 function getBrowseBlock ($aParams, $aCustom = array(), $sMainUrl =
'', $bClearJoins =
true)
283 $aJoins = $bClearJoins ? array(
'albumsObjects',
'albums') : array_keys($this->aCurrent[
'join']);
284 $this->
clearFilters(array(
'activeStatus',
'albumType',
'album_status',
'ownerStatus'), $aJoins);
286 $aCustomTmpl = array(
287 'enable_center' =>
true,
288 'unit_css_class' =>
' > div:not(.clear_both)',
292 'simple_paginate' =>
true,
293 'dynamic_paginate' =>
true,
295 'menu_bottom' =>
true,
296 'menu_bottom_type' =>
'browseAll',
297 'menu_bottom_param'=>
''
299 $aCustom = array_merge($aCustomTmpl, $aCustom);
300 $this->aCurrent[
'paginate'][
'perPage'] = (int)$aCustom[
'per_page'];
301 $this->aCurrent[
'paginate'][
'page'] = (int)$aCustom[
'page'];
302 $this->aCurrent[
'sorting'] = $aCustom[
'sorting'];
303 foreach ($aParams
as $sKey => $mixedValues) {
304 if (isset($this->aCurrent[
'restriction'][$sKey]))
305 $this->aCurrent[
'restriction'][$sKey][
'value'] = $mixedValues;
308 $bWrapDisable =
true;
309 if ($this->aCurrent[
'paginate'][
'totalNum'] > 0) {
310 foreach ($aList
as $aData)
312 $sCode .=
'<div class="clear_both"></div>';
314 if($aCustom[
'wrapper_class'])
315 $sCode =
'<div class="' . $aCustom[
'wrapper_class'] .
'">' .
$sCode .
'</div>';
317 if($aCustom[
'enable_center'])
320 $sCode =
$GLOBALS[
'oSysTemplate']->parseHtmlByName(
'default_margin_thd.html', array(
324 if ($aCustom[
'dynamic_paginate']) {
325 $aExclude = array($this->aCurrent[
'name'] .
'_mode',
'r');
327 $sOnChange =
'return !loadDynamicBlock({id}, \'' . $sMainUrl . $aLinkAddon[
'params'] . $aLinkAddon[
'paginate'] .
'\');
';
330 $aMenuTop = $aCustom['menu_top
'] ? $this->getTopMenu($aExclude): array();
331 $mixedMenuBottom = array();
332 if ($aCustom['menu_bottom
'])
333 $mixedMenuBottom = $this->getBottomMenu($aCustom['menu_bottom_type
'], 0, $this->aCurrent['restriction
'][$aCustom['menu_bottom_param
']]['value'], array(), $aCustom['simple_paginate
']);
334 return array('code' => $sCode, 'menu_top
'=> $aMenuTop, 'menu_bottom
' => $mixedMenuBottom, 'wrapper
' => $bWrapDisable);
337 function serviceGetBrowseBlock ($aParams, $sMainUrl = '', $aCustom = array())
339 $aCode = $this->getBrowseBlock($aParams, $aCustom, $sMainUrl);
340 return $aCode['code'] . $aCode['menu_bottom
'];
344 * Get number of all elements under specified search criterias
345 * @param array $aFilter - search criteria like 'restriction key
'=>'rest.
value'
346 * @param array $aJoin - list of joins elements from $this->aCurrent['join
'] field which shouldn't be cleared,
347 if empty then all current joins will be left
352 if (is_array($aFilter)) {
354 if (!is_array($aJoin) ||
empty($aJoin))
355 $aCurrJoins = array_keys($this->aCurrent[
'join']);
357 $aCurrJoins = $aJoin;
358 $this->
clearFilters(array(
'activeStatus'), $aCurrJoins);
359 foreach ($aFilter
as $sKey => $mixedValue) {
360 if (isset($this->aCurrent[
'restriction'][$sKey]))
361 $this->aCurrent[
'restriction'][$sKey][
'value'] = $mixedValue;
static getBlockCaptionItemCode( $iBlockID, $aLinks)
URI MungeSecretKey $secret_key</pre >< p > If the output is TRUE
getLinkAddByPrams($aExclude=array())
getBrowseBlock($aParams, $aCustom=array(), $sMainUrl='', $bClearJoins=true)
the intent is to exercise the right to control the distribution of derivative or collective works based on the Library In mere aggregation of another work not based on the Library with the you must alter all the notices that refer to this so that they refer to the ordinary GNU General Public instead of to this it is irreversible for that so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy This option is useful when you wish to copy part of the code of the Library into a program that is not a library You may copy and distribute the which must be distributed under the terms of Sections and above on a medium customarily used for software interchange If distribution of object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code
displaySearchBox($sCode, $sPaginate='', $bAdminBox=false)
ch_import($sClassName, $aModule=array())
getCurrentUrl($sType, $iId, $sUri, $aOwner='')
getPaginate($iStart=-1, $iPerPage=-1, $sTemplate=false)
static showAdminFilterPanel($sFilterValue, $sInputId='filter_input_id', $sCheckboxId='filter_checkbox_id', $sFilterName='filter', $sOnApply='')
getBottomMenu($sAllLinkType='browseAll', $iId=0, $sUri='', $aExclude=array(), $bPgnSim=TRUE)
_transformData($aUnit, $sTempl, $sCssHeader='')
ch_html_attribute($mixedInput)
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Library under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the Lesser General Public License from time to time Such new versions will be similar in spirit to the present but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number
DesignBoxAdmin($sTitle, $sContent, $mixedTopItems='', $sBottomItems='', $iIndex=1)
getParam($sParamName, $bUseCache=true)
and distribute a copy of this License along with the Library You may charge a fee for the physical act of transferring a and you may at your option offer warranty protection in exchange for a fee You may modify your copy or copies of the Library or any portion of thus forming a work based on the and copy and distribute such modifications or work under the terms of Section provided that you also meet all of these other than as an argument passed when the facility is then you must make a good faith effort to ensure in the event an application does not supply such function or table
displaySearchUnit($aData)
however that any such election will not serve to withdraw this and this License will continue in full force and effect unless terminated as stated above Miscellaneous Each time You Distribute or Publicly Perform the Work or a the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License Each time You Distribute or Publicly Perform an Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License If any provision of this License is invalid or unenforceable under applicable it shall not affect the validity or enforceability of the remainder of the terms of this and without further action by the parties to this such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent This License constitutes the entire agreement between the parties with respect to the Work licensed here There are no agreements or representations with respect to the Work not specified here Licensor shall not be bound by any additional provisions that may appear in any communication from You This License may not be modified without the mutual written agreement of the Licensor and You The rights granted and the subject matter in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic the Rome Convention of
clearFilters($aPassParams=array(), $aPassJoins=array())
if(!defined("USER_STATUS_TYPE")) define("USER_STATUS_TYPE" type
showPagination($aParams=array())
getTopMenu($aExclude=array())
_t($key, $arg0="", $arg1="", $arg2="")
that in the case of a Adaptation or at a minimum such credit will if a credit for all contributing authors of the Adaptation or Collection then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors For the avoidance of You may only use the credit required by this Section for the purpose of attribution in the manner set out above by exercising Your rights under this You may not implicitly or explicitly assert or imply any connection sponsorship or endorsement by the Original Licensor and or Attribution as of You or Your use of the without the express prior written permission of the Original Licensor and or Attribution Parties Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable if You Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or You must not modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author s honor or reputation Licensor agrees that in those in which any exercise of the right granted in modification or other derogatory action prejudicial to the Original Author s honor and the Licensor will waive or not as this to the fullest extent permitted by the applicable national to enable You to reasonably exercise Your right under Warranties and Disclaimer UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN LICENSOR OFFERS THE WORK AS IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE STATUTORY OR WITHOUT WARRANTIES OF FITNESS FOR A PARTICULAR OR THE ABSENCE OF LATENT OR OTHER OR THE PRESENCE OF ABSENCE OF WHETHER OR NOT DISCOVERABLE SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED SO SUCH EXCLUSION MAY NOT APPLY TO YOU Limitation on Liability EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES Termination This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License Individuals or entities who have received Adaptations or Collections from You under this will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses and will survive any termination of this License Subject to the above terms and the license granted here is Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time
URI Base such as when URI MakeAbsolute is on You may use a non absolute URI for this value
static showAdminActionsPanel($sWrapperId, $aButtons, $sCheckboxName='entry', $bSelectAll=true, $bSelectAllChecked=false, $sCustomHtml='')
DesignBoxContent($title, $content, $db_num=0, $caption_item='', $bottom_item='')
Attr AllowedRel this is empty
serviceGetAllCount($aFilter, $aJoin=array())
to broadcast and rebroadcast the Work by any means including sounds or images Reproduce means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the including storage of a protected performance or phonogram in digital form or other electronic medium Fair Dealing Rights Nothing in this License is intended to or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws License Grant Subject to the terms and conditions of this Licensor hereby grants You a royalty non perpetual(for the duration of the applicable copyright) license to exercise the rights in the Work as stated below to create and Reproduce Adaptations provided that any such including any translation in any takes reasonable steps to clearly label