Tilt is a Firefox addon that lets you visualize any web page in 3D. More info and videos I instaled it today. It seems to be very helpful to understand webpage structure in addition to Firebug.
I expanded the class XoopsFormSelect for my needs, but may also be useful to someone. I needed to color a few items in the select list. Of course you can use javascript. In this case it was convenient for me to modify the methods of the class (only addOption, addOptionArray not). In Xoops 2.2.x was also able to option disabled, so I added it too.
class pfXoopsFormSelect extends XoopsFormSelect { /** * Options * * @var array * @access private */ var $_options = array();
/** * Constructor * * @param string $caption Caption * @param string $name "name" attribute * @param mixed $value Pre-selected value (or array of them). * @param int $size Number or rows. "1" makes a drop-down-list * @param bool $multiple Allow multiple selections? */ function pfXoopsFormSelect($caption, $name, $value = null, $size = 1, $multiple = false) { $this->setCaption($caption); $this->setName($name); $this->_multiple = $multiple; $this->_size = intval($size); if (isset($value)) { $this->setValue($value); } }
/** * Add an option * * @param string $value "value" attribute * @param string $name "name" attribute * @param array,string $styles style definitions or class name (CSS) * @param bool $disabled set option as disabled if true */ function addOption($value, $name = '', $styles = null, $disabled = false) { if ($name != '') { $this->_options[$value]['name'] = $name; } else { $this->_options[$value]['name'] = $value; } if (is_array($styles)) { $this->_options[$value]['style'] = $styles['style']; $this->_options[$value]['class'] = $styles['class']; } else if (!empty($styles)) { $this->_options[$value]['class'] = $styles; } if ($disabled === true) { $this->_options[$value]['disabled'] = true; } }
/** * Prepare HTML for output * * @return string HTML */ function render() { $ele_name = $this->getName(); $ele_title = $this->getTitle(); $ele_value = $this->getValue(); $ele_options = $this->getOptions(); $ret = ''; return $ret; }
Better solution - use OOP: extend original class XoopsFormTextDateSelect and add parameter $autofill
class pfFormTextDateSelect extends XoopsFormTextDateSelect {
/** * Constructor * * @param string $caption Caption * @param string $name "name" attribute * @param int $size Size * @param int,string $value Initial date (timestamp format) or English textual datetime description which can be converted to timestamp (see: strtotime PHP function) * @param bool $autofill If $value is empty or not recognized textual datetime the form field filled current date ($autofill = true) or leave empty */ function pfFormTextDateSelect($caption, $name, $size = 15, $value = 0, $autofill = true) { // previous to PHP 5.1.0 you would compare with -1, instead of false if ( strtotime($value) !== false OR strtotime($value) != -1 ) { $value = strtotime($value); } if ( $autofill === true ) { $value = !is_numeric($value) ? time() : intval($value); $value = ($value == 0) ? time() : $value; } else { $value = !is_numeric($value) ? '' : intval($value); $value = ($value == 0) ? '' : $value; } $this->XoopsFormText($caption, $name, $size, 25, $value); }
}
Moreover this class accepts English textual datetime description and convert it into a timestamp (see http://php.net/manual/en/function.strtotime.php). Example, this displays a later date by one day:
new pfFormTextDateSelect('', 'test', 10, '+1 day', false);
Empty field:
new pfFormTextDateSelect('', 'test', 10, '', false);
NOTICE: This my function from above doesn't work since Xoops 2.5.4. There were changes in xoops calendar and the file: /include/calendarjs.php even not exist in the latest Xoops.
I have an other dummy question what is the diffrence between XoopsObjectHandler and XoopsPresistentObjectHandler?
Look into /kernel/object.php XoopsPresistentObjectHandler has the same methods (and many more) like XoopsObjectHandler. But "fill" them with code. I'm using only XoopsPresistentObjectHandler, so I do not know if XoopsObjectHandler is useful to something.
Great (but simple) article about PNG format. PNG supports various combinations of color depth, transparency and color correction. Some combinations work perfectly with every piece of software, and some are practically useless.
novlang1984 wrote: Just add this to ckeditor/config.js
You can also add this to file ckeditor/module/config.oledrion.js (it's placeholder for module specific configurations in CKEditor). In case when updating CKEditor file ckeditor/config.js will be replaced by the original one.
The biggest difference between smarty 2 and 3 is that the S3 has been completely rewritten in PHP5. S3 placed great emphasis on backwards compatibility, so apart from the fact that it will not work on php4 there should be no other problems. But therefore not expect great changes in speed. Smarty 3 is not a revolution.
PS. Looking for information on Smarty landed on http://dwoo.org/ project. It seems that it is compatible with smarty but is more advanced. Not tested, showing only as a curiosity ;)