This is an old revision of the document!


Internal function call

Basic function {SHOW_CONTENT:....}

File: /include/inc_front/ext.func.inc.php

Docu: http://www.phpwcms-docu.de/article_tags.phtml

Tag: {SHOW_CONTENT:MODE,id,id,id} → function: showSelectedContent('Mode,'.id.','.id.','.id)

The basic function in framework from {SHOW_CONTENT …} without a replacement tag.

Call:

$show_content = 'CPA,' . $id; // wherever $id might come from
echo showSelectedContent($show_content);


Init Mootools Library

File: /include/inc_front/front.func.inc.php

Docu:

Tag: – → function: initMootools($v='1.11')

Initialize the active mootools framework in /template/inc_js/mootools/mootools.js

Registriert mit:

  • mootools.js

Call:

initMootools();


Init Lightbox

File: /include/inc_front/front.func.inc.php

Docu:

Tag: – → function: initializeLightbox()

Initialize the SlimBox /template/inc_js/slimbox/js/slimbox.js und den und Mootools (see above).

Registered with:

  • lightbox.css for the CSS file
  • slimbox.js für die JS file

Call:

initializeLightbox();


Reset Init Lightbox

If the initialization of the Lighbox (SlimBox) -JS in the head range are in a wrong sequence to other scripts, you can reset the old entry and setup a new one:

Call:

Unset ($GLOBALS['block']['custom_htmlhead']['slimbox.js']);
initializeLightbox();
 
// alternatively for initializeLightbox();
// $GLOBALS['block']['custom_htmlhead']['slimbox.js'] = '  <script type="text/javascript" src="template/slimbox/js/slimbox.js" ></script>';


Init SwfObject JS Library

File: /include/inc_front/front.func.inc.php

Docu:

Tag: – → function: initSwfObject($v='2.2')

Initialize: /template/inc_js/swfobject/swfobject.js

Registered with:

  • swfobject.js (v1.5)
  • swfobject2.1.js (Default, V2.1, V2.2)

Call:

// template/inc_js/swfobject/swfobject.js
initSwfObject($v='1.5');
 
// template/inc_js/swfobject/2.2/swfobject.js
initSwfObject();  // default
initSwfObject($v='2.1');
initSwfObject($v='2.2');


article menu

File: /include/inc_front/front.func.inc.php

Docu:

Tag: – → function: getArticleMenu($data=array())

Return menu or menu elements based on article menu title information starting at given structure level ID, limited to single level (non-nested)

@return mixed (array/string)
@param array

Supplies an article list of the indicated category

$defaults = array(
 
    'level_id'              => 0,
    'class_active'          => 'active',
    'wrap_title_prefix'     => '',
    'wrap_title_suffix'     => '',
    'item_prefix'           => "\t",
    'item_suffix'           => '',
    'sort'                  => 'level',
    'item_tag'              => 'li',
    'wrap_tag'              => 'ul',
    'attribute_wrap_tag'    => '',
    'class_item_tag'        => '',
    'class_first_item_tag'  => '',
    'class_last_item_tag'   => '',
    'return_format'         => 'string' // string or array
 
);


E.g. category id=1 contains three articles and the output is a string:

$_menu = array('level_id'=>'1','attribute_wrap_tag'=>'wrap');
echo 'Article title: '.getarticlemenu($_menu);

Result dump (string):

<ul wrap>
    <li><a href="index.php?cat01_b">Cat01_B</a></li>
    <li><a href="index.php?cat01_c">Cat01_C</a></li>
    <li><a href="index.php?cat01_d">Cat01_D</a></li>
</ul>


E.g. category id=1 contains three articles and the output is an array:

$_menu = array('level_id'=>'1','attribute_wrap_tag'=>'wrap','return_format'=>'array');
echo 'Article title: '.getarticlemenu($_menu);

Result dump (array):

Array
(
    [0] => <ul wrap>
    [1] =>     <li><a href="index.php?cat01_b">Cat01_B</a></li>
    [2] =>     <li><a href="index.php?cat01_c">Cat01_C</a></li>
    [3] =>     <li><a href="index.php?cat01_d">Cat01_D</a></li>
    [4] => </ul>
)



Add a meta tag into HTML Head

File: /include/inc_front/front.func.inc.php

E.g. calling by a frontend_render script:

set_meta($name='', $content='', $http_equiv=FALSE);


Example:

set_meta('copyright', '2009 OG');

Result:

<meta name="copyright" content="2009 OG" />


Example:

set_meta('imagetoolbar', 'no', true);

Result:

<meta http-equiv="imagetoolbar" content="no" />


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:

            // 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';


Template:


Before processing:


After processing:



Short link overview

english/technics/internal-function-call.1259314255.txt.gz · Last modified: 2018/06/03 18:07 (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