Example #1
0
/**
 * Get a table of emoticons.
 *
 * @return tempcode		emotocons
 */
function placeholder_emoticon_chooser()
{
    $em = new ocp_tempcode();
    foreach (placeholder_emoticons() as $emo) {
        $code = $emo[2];
        $em->attach(do_lorem_template('EMOTICON_CLICK_CODE', array('_GUID' => '93968e9ff0308fff92d1d45e433557e2', 'FIELD_NAME' => 'post', 'CODE' => $code, 'IMAGE' => apply_emoticons($code))));
    }
    return $em;
}
Example #2
0
 /**
  * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
  * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
  * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
  *
  * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
  */
 function tpl_preview__block_main_emoticon_codes()
 {
     $smilies = placeholder_emoticons();
     $entries = new ocp_tempcode();
     global $EMOTICON_LEVELS;
     foreach ($smilies as $code => $imgcode) {
         if (is_null($EMOTICON_LEVELS) || $EMOTICON_LEVELS[$code] < 3) {
             $entries->attach(do_lorem_template('BLOCK_MAIN_EMOTICON_CODES_ENTRY', array('CODE' => $code, 'TPL' => do_emoticon($imgcode))));
         }
     }
     return array(lorem_globalise(do_lorem_template('BLOCK_MAIN_EMOTICON_CODES', array('ENTRIES' => $entries)), NULL, '', true));
 }
Example #3
0
 /**
  * Get a preview(s) of a (group of) template(s), as a full standalone piece of HTML in Tempcode format.
  * Uses sources/lorem.php functions to place appropriate stock-text. Should not hard-code things, as the code is intended to be declaritive.
  * Assumptions: You can assume all Lang/CSS/Javascript files in this addon have been pre-required.
  *
  * @return array			Array of previews, each is Tempcode. Normally we have just one preview, but occasionally it is good to test templates are flexible (e.g. if they use IF_EMPTY, we can test with and without blank data).
  */
 function tpl_preview__emoticon_click_code()
 {
     $emoticon = placeholder_emoticons();
     $emt = new ocp_tempcode();
     foreach ($emoticon as $k => $v) {
         $emt->attach(do_lorem_template('EMOTICON_IMG_CODE_THEMED', array('EMOTICON' => $k, 'SRC' => $v[1])));
     }
     $emt->attach(do_lorem_template('EMOTICON_IMG_CODE_DIR', array('EMOTICON' => lorem_word(), 'SRC' => get_base_url() . '/themes/default/images//ocf_emoticons/constipated.png')));
     return array(lorem_globalise(do_lorem_template('EMOTICON_CLICK_CODE', array('FIELD_NAME' => lorem_word(), 'CODE' => lorem_word(), 'IMAGE' => $emt)), NULL, '', true));
 }