nomail_forme Posted May 28, 2012 Share Posted May 28, 2012 I'm recreating a template of 2.2 in 2.3.1. The Left column php is removed in 2.3.1 and instead modules are introduced. In 2.3.1 The getdata function returns some of the code pertaining to the look of the Categories column. This is what is originally retirned $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_CATEGORIES_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents">' . $categories_string . '</div>' . '</div>'; return $data; The <div class=" is what i wanted to change. But it is not working.Can anybody explain how the data returned is later interpreted by osCommerce in 2.2 the template simply used a custom box class defined in the boxes.php called infoBox2 . In the categories.php it simply created a object of this class in the end of the categories.php to generate the categories column. The categories list is being passed to the class constructor . The code pertaining to it is shown below. $info_box_contents = array(); $info_box_contents[] = array('text' => '<ul class="categories">' . $categories_string . '</ul>'); new infoBox2($info_box_contents); In 2.3.1 obviously i can't just create the object without breaking the grid structure( which i managed to maintain so far) AND the module like functionality. SO HOW DO I DO IT IN 2.3.1? any Approach or atlernative ideas would be appreciated. -Thanks for your answers so far **edit** I forgot to mention that there are almost NO differences between the 2.2 and 2.3.1 versions in the rest of the file. The only differences are that 2.3.1 is using the functions to add module functionality whereas 2.2 doesn't have the functions and the same code is just spread out through out the file AND the template has the last part of the code for creating the box object extra as mentioned above.. Link to comment Share on other sites More sharing options...
nomail_forme Posted May 28, 2012 Author Share Posted May 28, 2012 If you need any more info, the old topic was here - http://www.oscommerce.com/forums/topic/387234-what-data-is-returned-for-getdata-function-of-the-left-column-modules/ Link to comment Share on other sites More sharing options...
nomail_forme Posted May 28, 2012 Author Share Posted May 28, 2012 I tried this but did not work $data = '<?php new infoBox2(' . $info_box_contents . ');?>' ; Link to comment Share on other sites More sharing options...
nomail_forme Posted May 28, 2012 Author Share Posted May 28, 2012 In the old template the box is generated by php code. But in 2.3.1 in need to return HTML code . So solution is - if i am able to get back the HTML code generated by the php code as a string. ANY idea on how to do that?Please answer Link to comment Share on other sites More sharing options...
nomail_forme Posted May 28, 2012 Author Share Posted May 28, 2012 Solved it! :D :D I did it by converting the HTML code generated by creating object to a string and passing that string to the function. I did it by output buffering in PHP. I was struggling with this all day . Finally done. The code is as follows. ob_start(); new infoBox2($info_box_contents); $data = ob_get_clean(); return $data; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.