本文整理汇总了PHP中Editor::setToolbar方法的典型用法代码示例。如果您正苦于以下问题:PHP Editor::setToolbar方法的具体用法?PHP Editor::setToolbar怎么用?PHP Editor::setToolbar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Editor
的用法示例。
在下文中一共展示了Editor::setToolbar方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: NewException
/**
* Constructor ContactForm
* @param Page $page_object
* @param string $send_method
* @param string $table_style
*/
function __construct($page_object, $send_method, $table_style = '')
{
parent::__construct();
if (!isset($page_object) || !isset($send_method)) {
throw new NewException("2 arguments for " . get_class($this) . "::__construct() are mandatory", 0, getDebugBacktrace(1));
}
if (gettype($page_object) != "object" || !is_subclass_of($page_object, "Page")) {
throw new NewException("Argument page_object for " . get_class($this) . "::__construct() error", 0, getDebugBacktrace(1));
}
$this->page_object = $page_object;
$this->mail_to = SMTP_MAIL;
$this->mail_to_name = SMTP_NAME;
$table_main = new Table();
$table_main->setClass($table_style);
$form = new Form($this->page_object);
$name = new TextBox($form, "contact_name");
$name_validation = new LiveValidation();
$name->setLiveValidation($name_validation->addValidatePresence()->setFieldName(__(CONTACTFORM_NAME)));
$table_main->addRowColumns(__(CONTACTFORM_NAME) . ": ", $name->setFocus())->setColumnWidth(2, "100%");
$email = new TextBox($form, "contact_email");
$email_validation = new LiveValidation();
$email->setLiveValidation($email_validation->addValidateEmail()->addValidatePresence()->setFieldName(__(CONTACTFORM_EMAIL)));
$table_main->addRowColumns(__(CONTACTFORM_EMAIL) . ": ", $email);
$subject = new TextBox($form, "contact_subject");
$subject_validation = new LiveValidation();
$subject->setLiveValidation($subject_validation->addValidatePresence()->setFieldName(__(CONTACTFORM_SUBJECT)));
$table_main->addRowColumns(__(CONTACTFORM_SUBJECT) . ": ", $subject);
$table_main->addRow();
$editor = new Editor($form, "contact_message");
$editor_validation = new LiveValidation();
$editor->setLiveValidation($editor_validation->addValidatePresence()->setFieldName(__(CONTACTFORM_MESSAGE)));
$editor->setToolbar(Editor::TOOLBAR_SIMPLE);
$table_main->addRow(new Object(__(CONTACTFORM_MESSAGE) . ": ", "<br/>", $editor))->setColspan(3)->setAlign(RowTable::ALIGN_LEFT);
$table_main->addRow();
$this->captcha = new Captcha($form, "contact_captcha");
$table_main->addRow($this->captcha)->setColspan(3);
$table_main->addRow();
$this->send_button = new Button($form, "contact_send", "", __(CONTACTFORM_SEND));
$this->send_button->assignEnterKey()->onClick($send_method)->setAjaxEvent();
$table_main->addRow($this->send_button)->setColspan(3);
$table_main->addRow();
$form->setContent($table_main);
$this->render = $form;
}
示例2: editor
/**
* FormHandler::editor()
*
* Create a editor on the form
*
* @param string $title: The title of the field
* @param string $name: The name of the field
* @param string $validator: The validator which should be used to validate the value of the field
* @param string $path: Path on the server where we have to upload the files
* @param string $toolbar: The toolbar we have to use
* @param string $skin: The skin to use
* @param int $width: The width of the field
* @param int $height: The height of the field
* @param boolean $useArrayKeyAsValue: If the array key's are the values for the options in the field
* @param string $extra: CSS, Javascript or other which are inserted into the HTML tag
* @return void
* @access public
* @author Teye Heimans
*/
function editor($title, $name, $validator = null, $path = null, $toolbar = null, $skin = null, $width = null, $height = null, $config = null)
{
require_once FH_INCLUDE_DIR . 'fields/class.TextArea.php';
require_once FH_INCLUDE_DIR . 'fields/class.Editor.php';
// create a new editor
$fld = new Editor($this, $name);
if (!empty($validator)) {
$fld->setValidator($validator);
}
if (!is_null($path)) {
$fld->setServerPath($path);
}
if (!empty($toolbar)) {
$fld->setToolbar($toolbar);
}
if (!empty($skin)) {
$fld->setSkin($skin);
}
if (!empty($width)) {
$fld->setWidth($width);
}
if (!empty($height)) {
$fld->setHeight($height);
}
if (is_array($config)) {
$fld->setConfig($config);
}
// register the field
$this->_registerField($name, $fld, $title);
}
示例3: prepareFieldsArray
//.........这里部分代码省略.........
if (isset($attribute_properties["update"]) && $attribute_properties["update"] == false) {
$is_update_ok = false;
}
$method = "get" . $this->getFormatValue($attribute);
$value = call_user_func_array(array($this->database_model_object, $method), array());
if ($attribute != $auto_increment_id && $is_update_ok) {
// get property cmb_obj
if (isset($attribute_properties['cmb_obj'])) {
$field = $attribute_properties['cmb_obj'];
} else {
if (isset($attribute_properties["wspobject"]) && $attribute_properties["wspobject"] != "") {
$wspobject = $attribute_properties["wspobject"];
} else {
if ($list_attribute_type[$i] == "datetime") {
$wspobject = "Calendar";
} else {
if ($list_attribute_type[$i] == "boolean") {
$wspobject = "CheckBox";
}
}
}
if ($wspobject == "Calendar") {
$field = new Calendar($this->form_or_page);
} else {
if ($wspobject == "CheckBox") {
$field = new CheckBox($this->form_or_page);
} else {
if ($wspobject == "TextArea") {
$field = new TextArea($this->form_or_page);
} else {
if ($wspobject == "Editor") {
$field = new Editor($this->form_or_page);
if (isset($attribute_properties["editor_param"]) && $attribute_properties["editor_param"] != "") {
$field->setToolbar($attribute_properties["editor_param"]);
}
} else {
if ($wspobject == "ComboBox") {
$field = new ComboBox($this->form_or_page);
if (isset($attribute_properties["combobox_values"])) {
if (is_array($attribute_properties["combobox_values"])) {
for ($j = 0; $j < sizeof($attribute_properties["combobox_values"]); $j++) {
$field->addItem($attribute_properties["combobox_values"][$j]['value'], $attribute_properties["combobox_values"][$j]['text']);
}
} else {
throw new NewException(get_class($this) . "->prepareFieldsArray() error: the property combobox_values need to be an array.", 0, getDebugBacktrace(1));
}
}
} else {
$field = new TextBox($this->form_or_page);
if ($list_attribute_type[$i] == "integer" || $list_attribute_type[$i] == "double") {
$field->setWidth(70);
}
if (in_array($attribute, $key_attributes)) {
$lv = new LiveValidation();
$field->setLiveValidation($lv->addValidatePresence());
}
}
}
}
}
}
}
// Handle Checkbox case that only support value as "on" or "off"
if (get_class($field) == "CheckBox") {
if ($value == "1") {
$field->setValue("on");
示例4: createDbAttributeObject
/**
* Method createDbAttributeObject
* @access private
* @param mixed $row
* @param mixed $list_attribute
* @param mixed $list_attribute_type
* @param mixed $i
* @param mixed $ind
* @param mixed $key_attributes
* @return mixed
* @since 1.1.6
*/
private function createDbAttributeObject($row, $list_attribute, $list_attribute_type, $i, $ind, $key_attributes)
{
// get property cmb_obj (created by method loadFromSqlDataView)
if (isset($this->from_sql_data_view_properties[$list_attribute[$i]]['cmb_obj'])) {
$input_obj_tmp = $this->from_sql_data_view_properties[$list_attribute[$i]]['cmb_obj'];
$input_obj = clone $input_obj_tmp;
$input_obj->setName($this->id . "_input_" . $list_attribute[$i] . "_ind_" . $ind);
$register_objects = WebSitePhpObject::getRegisterObjects();
$register_objects[] = $input_obj;
$_SESSION['websitephp_register_object'] = $register_objects;
} else {
$wspobject = "TextBox";
$attribute_properties = array();
if (is_array($this->from_sql_data_view_properties[$list_attribute[$i]])) {
$attribute_properties = $this->from_sql_data_view_properties[$list_attribute[$i]];
}
if (isset($attribute_properties["wspobject"]) && $attribute_properties["wspobject"] != "") {
$wspobject = $attribute_properties["wspobject"];
} else {
if ($list_attribute_type[$i] == "datetime") {
$wspobject = "Calendar";
} else {
if ($list_attribute_type[$i] == "boolean") {
$wspobject = "CheckBox";
}
}
}
if ($wspobject == "Calendar") {
$input_obj = new Calendar($this->table_form_object, $this->id . "_input_" . $list_attribute[$i] . "_ind_" . $ind);
} else {
if ($wspobject == "CheckBox") {
$input_obj = new CheckBox($this->table_form_object, $this->id . "_input_" . $list_attribute[$i] . "_ind_" . $ind);
} else {
if ($wspobject == "TextArea") {
$input_obj = new TextArea($this->table_form_object, $object_id);
} else {
if ($wspobject == "Editor") {
$input_obj = new Editor($this->table_form_object, $object_id);
if (isset($attribute_properties["editor_param"]) && $attribute_properties["editor_param"] != "") {
$input_obj->setToolbar($attribute_properties["editor_param"]);
}
} else {
if ($wspobject == "ComboBox") {
$input_obj = new ComboBox($this->table_form_object, $object_id);
if (isset($attribute_properties["combobox_values"])) {
if (is_array($attribute_properties["combobox_values"])) {
for ($j = 0; $j < sizeof($attribute_properties["combobox_values"]); $j++) {
$input_obj->addItem($attribute_properties["combobox_values"][$j]['value'], $attribute_properties["combobox_values"][$j]['text']);
}
} else {
throw new NewException(get_class($this) . "->loadFromSqlDataView() error: the property combobox_values need to be an array.", 0, getDebugBacktrace(1));
}
}
} else {
$input_obj = new TextBox($this->table_form_object, $this->id . "_input_" . $list_attribute[$i] . "_ind_" . $ind);
if ($list_attribute_type[$i] == "integer" || $list_attribute_type[$i] == "double") {
$input_obj->setWidth(70);
}
if (in_array($list_attribute[$i], $key_attributes)) {
$lv = new LiveValidation();
$input_obj->setLiveValidation($lv->addValidatePresence());
}
}
}
}
}
}
}
// get properties width and strip_tags
if (is_array($this->from_sql_data_view_properties[$list_attribute[$i]])) {
$attribute_properties = $this->from_sql_data_view_properties[$list_attribute[$i]];
if (isset($attribute_properties["width"]) && method_exists($input_obj, "setWidth")) {
$input_obj->setWidth($attribute_properties["width"]);
}
if (isset($attribute_properties["height"]) && method_exists($input_obj, "setHeight")) {
$input_obj->setHeight($attribute_properties["height"]);
}
if (isset($attribute_properties["class"]) && method_exists($input_obj, "setClass")) {
$input_obj->setClass($attribute_properties["class"]);
}
if (isset($attribute_properties["style"]) && method_exists($input_obj, "setStyle")) {
$input_obj->setStyle($attribute_properties["style"]);
}
if (isset($attribute_properties["disable"])) {
if ($attribute_properties["disable"] == true && method_exists($input_obj, "disable")) {
$input_obj->disable();
} else {
if ($attribute_properties["disable"] == false && method_exists($input_obj, "enable")) {
//.........这里部分代码省略.........