本文整理汇总了PHP中OptionsPropertyMainGroup::setForce方法的典型用法代码示例。如果您正苦于以下问题:PHP OptionsPropertyMainGroup::setForce方法的具体用法?PHP OptionsPropertyMainGroup::setForce怎么用?PHP OptionsPropertyMainGroup::setForce使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OptionsPropertyMainGroup
的用法示例。
在下文中一共展示了OptionsPropertyMainGroup::setForce方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setProperties
/**
* Sets the export HTML-Word properties
*
* @return void
*/
protected function setProperties()
{
$props = 'libraries/properties/';
include_once "{$props}/plugins/ExportPluginProperties.class.php";
include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
include_once "{$props}/options/items/RadioPropertyItem.class.php";
include_once "{$props}/options/items/TextPropertyItem.class.php";
include_once "{$props}/options/items/BoolPropertyItem.class.php";
$exportPluginProperties = new ExportPluginProperties();
$exportPluginProperties->setText('Microsoft Word 2000');
$exportPluginProperties->setExtension('doc');
$exportPluginProperties->setMimeType('application/vnd.ms-word');
$exportPluginProperties->setForceFile(true);
$exportPluginProperties->setOptionsText(__('Options'));
// create the root group that will be the options field for
// $exportPluginProperties
// this will be shown as "Format specific options"
$exportSpecificOptions = new OptionsPropertyRootGroup();
$exportSpecificOptions->setName("Format Specific Options");
// what to dump (structure/data/both)
$dumpWhat = new OptionsPropertyMainGroup();
$dumpWhat->setName("dump_what");
$dumpWhat->setText(__('Dump table'));
// create primary items and add them to the group
$leaf = new RadioPropertyItem();
$leaf->setName("structure_or_data");
$leaf->setValues(array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
$dumpWhat->addProperty($leaf);
// add the main group to the root group
$exportSpecificOptions->addProperty($dumpWhat);
// data options main group
$dataOptions = new OptionsPropertyMainGroup();
$dataOptions->setName("dump_what");
$dataOptions->setText(__('Data dump options'));
$dataOptions->setForce('structure');
// create primary items and add them to the group
$leaf = new TextPropertyItem();
$leaf->setName("null");
$leaf->setText(__('Replace NULL with:'));
$dataOptions->addProperty($leaf);
$leaf = new BoolPropertyItem();
$leaf->setName("columns");
$leaf->setText(__('Put columns names in the first row'));
$dataOptions->addProperty($leaf);
// add the main group to the root group
$exportSpecificOptions->addProperty($dataOptions);
// set the options for the export plugin property item
$exportPluginProperties->setOptions($exportSpecificOptions);
$this->properties = $exportPluginProperties;
}
示例2: setProperties
//.........这里部分代码省略.........
$values[$val] = $val;
}
$leaf = new SelectPropertyItem();
$leaf->setName("compatibility");
$leaf->setText(__('Database system or older MySQL server to maximize output' . ' compatibility with:'));
$leaf->setValues($values);
$leaf->setDoc(array('manual_MySQL_Database_Administration', 'Server_SQL_mode'));
$generalOptions->addProperty($leaf);
unset($values);
}
// server export options
if ($plugin_param['export_type'] == 'server') {
$leaf = new BoolPropertyItem();
$leaf->setName("drop_database");
$leaf->setText(sprintf(__('Add %s statement'), '<code>DROP DATABASE</code>'));
$generalOptions->addProperty($leaf);
}
// what to dump (structure/data/both)
$subgroup = new OptionsPropertySubgroup();
$subgroup->setName("dump_table");
$subgroup->setText("Dump table");
$leaf = new RadioPropertyItem();
$leaf->setName('structure_or_data');
$leaf->setValues(array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
$subgroup->setSubgroupHeader($leaf);
$generalOptions->addProperty($subgroup);
// add the main group to the root group
$exportSpecificOptions->addProperty($generalOptions);
// structure options main group
if (!$hide_structure) {
$structureOptions = new OptionsPropertyMainGroup();
$structureOptions->setName("structure");
$structureOptions->setText(__('Object creation options'));
$structureOptions->setForce('data');
// begin SQL Statements
$subgroup = new OptionsPropertySubgroup();
$leaf = new MessageOnlyPropertyItem();
$leaf->setName('add_statements');
$leaf->setText(__('Add statements:'));
$subgroup->setSubgroupHeader($leaf);
if ($plugin_param['export_type'] != 'table') {
$leaf = new BoolPropertyItem();
$leaf->setName('create_database');
$create_clause = '<code>CREATE DATABASE / USE</code>';
$leaf->setText(sprintf(__('Add %s statement'), $create_clause));
$subgroup->addProperty($leaf);
}
if ($plugin_param['export_type'] == 'table') {
if (PMA_Table::isView($GLOBALS['db'], $GLOBALS['table'])) {
$drop_clause = '<code>DROP VIEW</code>';
} else {
$drop_clause = '<code>DROP TABLE</code>';
}
} else {
if (PMA_DRIZZLE) {
$drop_clause = '<code>DROP TABLE</code>';
} else {
$drop_clause = '<code>DROP TABLE / VIEW / PROCEDURE' . ' / FUNCTION</code>';
if (PMA_MYSQL_INT_VERSION > 50100) {
$drop_clause .= '<code> / EVENT</code>';
}
}
}
$leaf = new BoolPropertyItem();
$leaf->setName('drop_table');
$leaf->setText(sprintf(__('Add %s statement'), $drop_clause));
示例3: setProperties
/**
* Sets the export Latex properties
*
* @return void
*/
protected function setProperties()
{
global $plugin_param;
$hide_structure = false;
if ($plugin_param['export_type'] == 'table' && !$plugin_param['single_table']) {
$hide_structure = true;
}
$props = 'libraries/properties/';
include_once "{$props}/plugins/ExportPluginProperties.class.php";
include_once "{$props}/options/groups/OptionsPropertyRootGroup.class.php";
include_once "{$props}/options/groups/OptionsPropertyMainGroup.class.php";
include_once "{$props}/options/items/BoolPropertyItem.class.php";
include_once "{$props}/options/items/RadioPropertyItem.class.php";
include_once "{$props}/options/items/TextPropertyItem.class.php";
$exportPluginProperties = new ExportPluginProperties();
$exportPluginProperties->setText('LaTeX');
$exportPluginProperties->setExtension('tex');
$exportPluginProperties->setMimeType('application/x-tex');
$exportPluginProperties->setOptionsText(__('Options'));
// create the root group that will be the options field for
// $exportPluginProperties
// this will be shown as "Format specific options"
$exportSpecificOptions = new OptionsPropertyRootGroup();
$exportSpecificOptions->setName("Format Specific Options");
// general options main group
$generalOptions = new OptionsPropertyMainGroup();
$generalOptions->setName("general_opts");
// create primary items and add them to the group
$leaf = new BoolPropertyItem();
$leaf->setName("caption");
$leaf->setText(__('Include table caption'));
$generalOptions->addProperty($leaf);
// add the main group to the root group
$exportSpecificOptions->addProperty($generalOptions);
// what to dump (structure/data/both) main group
$dumpWhat = new OptionsPropertyMainGroup();
$dumpWhat->setName("dump_what");
$dumpWhat->setText(__('Dump table'));
// create primary items and add them to the group
$leaf = new RadioPropertyItem();
$leaf->setName("structure_or_data");
$leaf->setValues(array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data')));
$dumpWhat->addProperty($leaf);
// add the main group to the root group
$exportSpecificOptions->addProperty($dumpWhat);
// structure options main group
if (!$hide_structure) {
$structureOptions = new OptionsPropertyMainGroup();
$structureOptions->setName("structure");
$structureOptions->setText(__('Object creation options'));
$structureOptions->setForce('data');
// create primary items and add them to the group
$leaf = new TextPropertyItem();
$leaf->setName("structure_caption");
$leaf->setText(__('Table caption:'));
$leaf->setDoc('faq6-27');
$structureOptions->addProperty($leaf);
$leaf = new TextPropertyItem();
$leaf->setName("structure_continued_caption");
$leaf->setText(__('Table caption (continued):'));
$leaf->setDoc('faq6-27');
$structureOptions->addProperty($leaf);
$leaf = new TextPropertyItem();
$leaf->setName("structure_label");
$leaf->setText(__('Label key:'));
$leaf->setDoc('faq6-27');
$structureOptions->addProperty($leaf);
if (!empty($GLOBALS['cfgRelation']['relation'])) {
$leaf = new BoolPropertyItem();
$leaf->setName("relation");
$leaf->setText(__('Display foreign key relationships'));
$structureOptions->addProperty($leaf);
}
$leaf = new BoolPropertyItem();
$leaf->setName("comments");
$leaf->setText(__('Display comments'));
$structureOptions->addProperty($leaf);
if (!empty($GLOBALS['cfgRelation']['mimework'])) {
$leaf = new BoolPropertyItem();
$leaf->setName("mime");
$leaf->setText(__('Display MIME types'));
$structureOptions->addProperty($leaf);
}
// add the main group to the root group
$exportSpecificOptions->addProperty($structureOptions);
}
// data options main group
$dataOptions = new OptionsPropertyMainGroup();
$dataOptions->setName("data");
$dataOptions->setText(__('Data dump options'));
$dataOptions->setForce('structure');
// create primary items and add them to the group
$leaf = new BoolPropertyItem();
$leaf->setName("columns");
$leaf->setText(__('Put columns names in the first row:'));
//.........这里部分代码省略.........