コード例 #1
0
ファイル: DBColumns.php プロジェクト: anas/feedstore
    }
    function addElementTo($args)
    {
        extract($args);
        return $form->addElement('button', 'cancel', 'Cancel', array("onClick" => "window.location.href='Monthly.php'"));
    }
}
class DBColumnURL extends DBColumnText
{
    function type()
    {
        return 'url';
    }
    function addElementTo($args)
    {
        $label = $this->label();
        extract($args);
        if (!@$value) {
            $value = "http://";
        }
        $el = $form->addElement('text', $id, $label);
        $el->setValue($value);
        $chars = "a-z0-9_";
        // Legal chars in the url
        $form->addRule($id, 'URL required, e.g., http://www.norex.ca', 'regex', "!http(s)?://[{$chars}]+!", 'client');
        return $el;
    }
}
/* ----------------------------- PUT NEW CLASSES ABOVE THIS LINE! ---------------------- */
DBColumn::registerClasses();
/* ------------------------------------------------------------------------------------- */