Differences

This shows you the differences between two versions of the page.

english:technics:internal-function-call [2009/11/21 10:01]
Knut Heermann (flip-flop)
english:technics:internal-function-call [2018/06/03 18:09] (current)
Line 24: Line 24:
===== Init Mootools Library ===== ===== Init Mootools Library =====
 +
 +==== Till V1.4.3 r380 ====
**File:** /include/inc_front/front.func.inc.php **File:** /include/inc_front/front.func.inc.php
Line 33: Line 35:
**Initialize** the active mootools framework in /template/inc_js/mootools/mootools.js **Initialize** the active mootools framework in /template/inc_js/mootools/mootools.js
-**Registriert** mit:+**Registered** with:
  * mootools.js   * mootools.js
Line 45: Line 47:
 +==== Since V1.4.4 r381 ====
 +
 +
 +**File:** /include/inc_front/front.func.inc.php
 +
 +**Docu:** [[http://forum.phpwcms.org/viewtopic.php?p=122090#p122090]]
 +
 +**Call:** initJSLib();
 +
 +**Tag:** -- -> **function:** initJSLib() //(in the corresponding JS-Lib in include/inc_front/lib/*)//
 +
 +
 +**Initializes** the currently active JS framework in **template/lib/mootools/*** or **template/lib/jquery/*** //(depending on the framework set up in template)//.
 +
 +**Registered** with ##mootools.js## if **MooTools 1.1/1.2** is set in template //(JS Library)//:
 +
 +**Call:**
 +<code php>initJSLib();</code>
 +
 +or
 +
 +**Registered** with ##jquery.js## if **jQuery 1.3/1.4** is set in template //(JS Library)//:
 +
 +**Call:**
 +<code php>initJSLib();</code>
 +
 +\\
 +After v1.4.3 R380 the handling for JS Libs and files was switched.
 +
 +
 +The call **initMootools();** does not exist anymore. Now it is substituted by **initJSLib();**, whereby the JS-Framework set in template is loaded.
 +
 +By using the call **initializeLightbox();** //(deprecated)// or **initSlimbox();**  the right JS framework is atom. loaded.
 +
 +
 +It must be changed all the external calls of the framework into this standardized way of calling.
 +
 +
 +Such calls:
 +<code php>
 +$GLOBALS['block']['custom_htmlhead']['mootools.js'] = '  <script src="'.TEMPLATE_PATH.'inc_js/smoothgallery/mootools.js" type="text/javascript"></script>';
 +</code>
 +
 +should / can no longer be used. Own Mootools sets are no longer the first choice. All components are present in the system.
 +
 +
 +If additional functions from the **Moore series** are used, then these can be integrated like this:
 +
 +
 +**In HTML-sourde:**
 +<code html><!-- JS: MORE:Fx/Fx.Elements,Fx/Fx.Accordion --></code>
 +
 +\\
 +**or as inline-PHP** //(not recommended)//:
 +<code php>
 +[PHP]
 +$js[1] = 'MORE:Fx/Fx.Elements,Fx/Fx.Accordion';
 +renderHeadJS($js);
 +[/PHP]
 +</code>
 +
 +\\
 +**or this variant** //(e.g. in a forntend_render-Script)//:
 +<code php>
 +$mootools_more = array(
 +        'Fx/Fx.Elements',
 +        'Fx/Fx.Accordion'
 +);
 +initJSPlugin($mootools_more, true);
 +</code>
 +\\
 +
 +=== External JavaScripts ===
 +** are merged best as Plugin:**
 +
 +**Example** SimpleTabs:
 +----------------------------------
 +**File:** template/lib/mootools/plugin-1.2/mootools.SimpleTabs.js \\
 +
 +Integrating with:
 +
 +<code php>
 +initJSPlugin('SimpleTabs');
 +
 +$GLOBALS['block']['css']['reg_tabs_simpletabs01'] = 'specific/mootools/reg_tabs_simpletabs01.css';
 +...
 +...
 +</code>
 +
 +**initJSPlugin('SimpleTabs');** the right JS framework calls.
 +
 +Alternatively, in a template:
 +<code php>
 +[PHp]initJSPlugin('SimpleTabs');[/PHP]
 +</code>
 +or
 +<code php>
 +<!-- JS: SimpleTabs -->
 +<!-- JS: http://digitarald.de/project/simple-tabs/1-0/source/SimpleTabs.js -->
 +</code>
 +
 +
 +<note important>
 +Since version r410 the call of external scripts like \\ ##%%<!-- JS: http://XYZ.js -->%%## for security is no longer possible. \\
 +
 +\\
 +Alternatively, this method can be selected:\\ ##%%[PHP]$GLOBALS['block']['custom_htmlhead']['XYZ'] = getJavaScriptSourceLink(html_specialchars('http://XYZ.js'));[/PHP] %%##
 +
 +</note>
 +
 +  * **External scripts** are now started from the appropriate plugin directory.
 +  * The original file name **SimpleTabs.js** will be prefixed by **mootools.** or **jquery.** ->  **mootools.SimpleTabs.js**.
 +
 +The right JS-framework is now automatically assigned by the system.
 +
 +
 +
 +<note>**All past external JS-integrations must be revised in this direction.**</note>
 +
 +
 +\\
 +
 +=== check instantly appointed JS Lib ===
 +
 +templates -> JS Library: [Var: PHPWCMS_JSLIB]
 +
 +
 +<code php>
 +if(PHPWCMS_JSLIB == 'mootools-1.1') { ...... }
 +if(PHPWCMS_JSLIB == 'mootools-1.2') { ...... }
 +if(PHPWCMS_JSLIB == 'jquery-1.3') { ...... }
 +if(PHPWCMS_JSLIB == 'jquery-1.4') { ...... }
 +</code>
 +
 +
 +~~UP~~
===== Init Lightbox ===== ===== Init Lightbox =====
Line 54: Line 192:
**Tag:** -- -> **function:** initializeLightbox() **Tag:** -- -> **function:** initializeLightbox()
-**Initialize** the SlimBox /template/inc_js/slimbox/js/slimbox.js und den und Mootools //(see above)//.+**Initialize %%<=%% v1.4.3 r380** the SlimBox /template/inc_js/slimbox/js/slimbox.js and Mootools //(see above)//.\\ 
 +**Initialize %%>=%% v1.4.4 r381** the SlimBox /template/lib/slimbox/[slimbox.mootools-1.1.js]|[slimbox.mootools-1.2.js]|[slimbox.jquery.js] and  Mootools //(see above)//. 
**Registered** with: **Registered** with:
Line 76: Line 216:
**Call:** **Call:**
<code php> <code php>
-Unset ($GLOBALS['block']['custom_htmlhead']['slimbox.js']);+// unset Slimbox CCC and JS 
 +Unset( 
 +    $GLOBALS['block']['custom_htmlhead']['lightbox.css'], 
 +    $GLOBALS['block']['custom_htmlhead']['slimbox.js'] 
 +); 
initializeLightbox(); initializeLightbox();
-// alternatively for initializeLightbox();+// Alternativ zu initializeLightbox()
 +// $GLOBALS['block']['['css']']['lightbox.css']       = '  ../lib/slimbox/slimbox.css';
// $GLOBALS['block']['custom_htmlhead']['slimbox.js'] = '  <script type="text/javascript" src="template/slimbox/js/slimbox.js" ></script>'; // $GLOBALS['block']['custom_htmlhead']['slimbox.js'] = '  <script type="text/javascript" src="template/slimbox/js/slimbox.js" ></script>';
</code> </code>
-\\+ 
 +~~UP~~
===== Init SwfObject JS Library ===== ===== Init SwfObject JS Library =====
Line 111: Line 258:
</code> </code>
-\\+~~UP~~
Line 192: Line 339:
-\\+~~UP~~
\\ \\
Line 224: Line 371:
<meta http-equiv="imagetoolbar" content="no" /> <meta http-equiv="imagetoolbar" content="no" />
</code> </code>
 +
 +
 +~~UP~~
 +
 +===== Subsequent exchange of a CSS file, which is registered in the Template  =====
 +
 +In special cases it is necessary to replace a CSS file that is entered in the template temporarily as required.. The process sequence of the CSS file is never modified :!: \\
 +With a small script that is possible.
 +
 +**Assumption:** \\
 +The file should be exchanged is called "**master_template.css**". \\
 +The new file is called "**winter.css**" and is located in the directory "template/inc_css/specific/*".
 +
 +
 +E.g.  Call from a frontend_render script:
 +
 +<code php>
 +            // Change Dummy/Fallback-css
 +            // the position in the order of the files is preserved
 +            // -------------------------------------------------------
 +            $my_css = 'master_template.css';
 +
 +            $key = array_search($my_css, $block['css']);
 +            if ($key) $block['css'][$key] = 'specific/winter.css';
 +</code>
 +
 +\\
 +
 +**Template:**
 +
 +
 +{{:deutsch:ersetzer_rts:frontend_render:be_template01_1.gif|}}
 +
 +\\
 +**Before processing:**
 +
 +{{:deutsch:ersetzer_rts:frontend_render:be_template03-1_1.gif|}}
 +
 +\\
 +**After processing:**
 +
 +{{:deutsch:ersetzer_rts:frontend_render:be_template03-2_1.gif|}}
 +
 +
\\ \\
english/technics/internal-function-call.1258794101.txt.gz · Last modified: 2018/06/03 18:08 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0