/sprout/Controllers/Admin/ManagedAdminController.php Highlighted file source
Line 147: * Modifiers applied to data prior to export
Line 151: protected $export_modifiers = array();
Line 307: * Returns the SQL query for use by the export tools.
Line 313: protected function _getExportQuery($where = '1')
Line 373: * Returns form for doing exports
Line 375: public function _getExport()
Line 377: $export = new View("sprout/admin/generic_export");
Line 378: $export->controller_name = $this->controller_name;
Line 379: $export->friendly_name = $this->friendly_name;
Line 383: $export->refine = $this->refine_bar->get();
Line 387: list($where, $params, $export->refine_fields) = $this->applyRefineFilter();
Line 394: $q = $this->_getExportQuery($where) . ' LIMIT 3';
Line 399: $modifiers = $this->export_modifiers;
Line 422: $export->itemlist = '<p><i>No records found which match the refinebar clauses specified.</i></p>';
Line 428: $export->itemlist = $itemlist->render();
Line 433: 'title' => 'Export ' . Enc::html(strtolower($this->friendly_name)),
Line 434: 'content' => $export->render(),
Line 440: * Does the actual export. Return false on error.
Line 448: public function _exportData()
Line 461: $q = $this->_getExportQuery($where);
Line 465: // Do the export
Line 468: $data = QueryTo::csv($res, $this->export_modifiers);
Line 475: $data = QueryTo::xml($res, $this->export_modifiers);
Line 489: * Returns a form which contains options for doing an export
Line 1759: $tools['export'] = "<li class=\"export\"><a href=\"SITE/admin/export/{$this->controller_name}\">Export {$friendly}</a></li>";
/sprout/Controllers/Admin/ManagedAdminController.php Highlighted file source
Line 147: * Modifiers applied to data prior to export
Line 151: protected $export_modifiers = array();
Line 307: * Returns the SQL query for use by the export tools.
Line 313: protected function _getExportQuery($where = '1')
Line 373: * Returns form for doing exports
Line 375: public function _getExport()
Line 377: $export = new View("sprout/admin/generic_export");
Line 378: $export->controller_name = $this->controller_name;
Line 379: $export->friendly_name = $this->friendly_name;
Line 383: $export->refine = $this->refine_bar->get();
Line 387: list($where, $params, $export->refine_fields) = $this->applyRefineFilter();
Line 394: $q = $this->_getExportQuery($where) . ' LIMIT 3';
Line 399: $modifiers = $this->export_modifiers;
Line 422: $export->itemlist = '<p><i>No records found which match the refinebar clauses specified.</i></p>';
Line 428: $export->itemlist = $itemlist->render();
Line 433: 'title' => 'Export ' . Enc::html(strtolower($this->friendly_name)),
Line 434: 'content' => $export->render(),
Line 440: * Does the actual export. Return false on error.
Line 448: public function _exportData()
Line 461: $q = $this->_getExportQuery($where);
Line 465: // Do the export
Line 468: $data = QueryTo::csv($res, $this->export_modifiers);
Line 475: $data = QueryTo::xml($res, $this->export_modifiers);
Line 489: * Returns a form which contains options for doing an export
Line 1759: $tools['export'] = "<li class=\"export\"><a href=\"SITE/admin/export/{$this->controller_name}\">Export {$friendly}</a></li>";
/sprout/Controllers/AdminController.php Highlighted file source
Line 545: public function export($type)
Line 554: if (! $this->checkAccess($ctlr, 'export', false)) return;
Line 558: $main = $ctlr->_getExport();
Line 579: public function exportAction($type)
Line 586: if (! $this->checkAccess($ctlr, 'export', true)) return;
Line 588: $result = $ctlr->_exportData();
Line 591: Notification::error('There was an error performing the export');
Line 592: Url::redirect("admin/export/{$type}");
/sprout/Controllers/AdminController.php Highlighted file source
Line 545: public function export($type)
Line 554: if (! $this->checkAccess($ctlr, 'export', false)) return;
Line 558: $main = $ctlr->_getExport();
Line 579: public function exportAction($type)
Line 586: if (! $this->checkAccess($ctlr, 'export', true)) return;
Line 588: $result = $ctlr->_exportData();
Line 591: Notification::error('There was an error performing the export');
Line 592: Url::redirect("admin/export/{$type}");
/sprout/Controllers/DbToolsController.php Highlighted file source
Line 40: use Sprout\Helpers\Export;
Line 41: use Sprout\Helpers\ExportTableSQL;
Line 121: [ 'url' => 'dbtools/exportFiles', 'name' => 'Export files', 'desc' => 'Exports all files' ],
Line 122: [ 'url' => 'dbtools/exportTables', 'name' => 'Export database', 'desc' => 'Export tables to an SQL file' ],
Line 125: [ 'url' => 'dbtools/importXML', 'name' => 'Import XML', 'desc' => 'Import Sprout2 CMS export' ],
Line 1029: * Export tables to an SQL file
Line 1031: public function exportTables()
Line 1073: echo '<form action="SITE/dbtools/exportAction" method="post">';
Line 1090: $type_options .= '<option value="' . ExportTableSQL::DATA_INSERT . '">Insert</option>';
Line 1091: $type_options .= '<option value="' . ExportTableSQL::DATA_BOTH . '">Insert...update</option>';
Line 1092: $type_options .= '<option value="' . ExportTableSQL::DATA_UPDATE .'">Update</option>';
Line 1093: $type_options .= '<option value="' . ExportTableSQL::DATA_CSV . '">CSV file</option>';
Line 1094: $type_options .= '<option value="' . ExportTableSQL::DATA_NONE . '">None</option>';
Line 1117: echo '<p><input type="checkbox" name="split_table" value="1"> Split the export per table.</p>';
Line 1118: echo '<p><input type="checkbox" name="split_size" value="1" checked> Split the export into chunks no bigger than <input type="text" name="split_amount" value="8m">. <small>(prefixes: k, m, g)</small></p>';
Line 1124: echo '<div class="action-bar"><button type="submit" class="button icon-after icon-save">Export</button></div>';
Line 1128: $this->template('Export tables');
Line 1154: * Does the actual export
Line 1158: * @post split_tables Split the export per table
Line 1159: * @post split_size Split the export by size
Line 1160: * @post split_amount Split the export by size - size in kb, mb or gb
Line 1164: public function exportAction()
Line 1172: $temp_filename = 'temp/export-' . time() . '-';
Line 1174: $class = 'Sprout\Helpers\ExportDBMS_' . $_POST['dbms'];
Line 1177: $export = new Export();
Line 1178: $export->setFilenamePrefix(APPPATH . $temp_filename);
Line 1179: $export->setDbms($dbms);
Line 1182: $export->split_table = true;
Line 1194: $export->split_size = $amt;
Line 1198: $table = new ExportTableSQL();
Line 1205: $export->addTable($table);
Line 1208: $export->exportSql();
Line 1216: $export->buildArchive($name);
Line 1219: $files = $export->getGeneratedFiles();
Line 1222: echo "<p><a href=\"SITE/dbtools/gettempfile/export-database/{$f_url}/{$f}\">{$f}</a></p>";
Line 1225: $this->template('Export tables');
Line 1315: * @param string $source The source of the file, one of 'export-database', 'export-files', 'module-builder'
Line 1324: 'export-database' => '/^export-[0-9]+-(?:sql_[-0-9]+_.+\.zip|.+\.sql)$/',
Line 1325: 'export-files' => '/^files_[-0-9]+_.+\.zip$/',
Line 1375: * UI to export all files
Line 1377: public function exportFiles()
Line 1383: echo '<p>NOTE: Exports of many files may take a long time and/or fail.</p>';
Line 1385: echo '<form action="dbtools/exportFilesAction" method="post">';
Line 1387: echo '<div class="action-bar"><button type="submit" class="button">Export files</button></div>';
Line 1390: $this->template('Export files');
Line 1395: * Action to export all files
Line 1397: public function exportFilesAction()
Line 1430: echo "<div class=\"action-bar\"><a href=\"SITE/dbtools/gettempfile/export-files/{$name}\" class=\"button icon-after icon-save\">Download: {$name}</a></div>";
Line 1432: $this->template('Export files');
Line 2864: * Renders form to imoprt Sprout2 Export XML
Line 2879: * Process Sprout2 Export XML into this CMS
/sprout/Controllers/DbToolsController.php Highlighted file source
Line 40: use Sprout\Helpers\Export;
Line 41: use Sprout\Helpers\ExportTableSQL;
Line 121: [ 'url' => 'dbtools/exportFiles', 'name' => 'Export files', 'desc' => 'Exports all files' ],
Line 122: [ 'url' => 'dbtools/exportTables', 'name' => 'Export database', 'desc' => 'Export tables to an SQL file' ],
Line 125: [ 'url' => 'dbtools/importXML', 'name' => 'Import XML', 'desc' => 'Import Sprout2 CMS export' ],
Line 1029: * Export tables to an SQL file
Line 1031: public function exportTables()
Line 1073: echo '<form action="SITE/dbtools/exportAction" method="post">';
Line 1090: $type_options .= '<option value="' . ExportTableSQL::DATA_INSERT . '">Insert</option>';
Line 1091: $type_options .= '<option value="' . ExportTableSQL::DATA_BOTH . '">Insert...update</option>';
Line 1092: $type_options .= '<option value="' . ExportTableSQL::DATA_UPDATE .'">Update</option>';
Line 1093: $type_options .= '<option value="' . ExportTableSQL::DATA_CSV . '">CSV file</option>';
Line 1094: $type_options .= '<option value="' . ExportTableSQL::DATA_NONE . '">None</option>';
Line 1117: echo '<p><input type="checkbox" name="split_table" value="1"> Split the export per table.</p>';
Line 1118: echo '<p><input type="checkbox" name="split_size" value="1" checked> Split the export into chunks no bigger than <input type="text" name="split_amount" value="8m">. <small>(prefixes: k, m, g)</small></p>';
Line 1124: echo '<div class="action-bar"><button type="submit" class="button icon-after icon-save">Export</button></div>';
Line 1128: $this->template('Export tables');
Line 1154: * Does the actual export
Line 1158: * @post split_tables Split the export per table
Line 1159: * @post split_size Split the export by size
Line 1160: * @post split_amount Split the export by size - size in kb, mb or gb
Line 1164: public function exportAction()
Line 1172: $temp_filename = 'temp/export-' . time() . '-';
Line 1174: $class = 'Sprout\Helpers\ExportDBMS_' . $_POST['dbms'];
Line 1177: $export = new Export();
Line 1178: $export->setFilenamePrefix(APPPATH . $temp_filename);
Line 1179: $export->setDbms($dbms);
Line 1182: $export->split_table = true;
Line 1194: $export->split_size = $amt;
Line 1198: $table = new ExportTableSQL();
Line 1205: $export->addTable($table);
Line 1208: $export->exportSql();
Line 1216: $export->buildArchive($name);
Line 1219: $files = $export->getGeneratedFiles();
Line 1222: echo "<p><a href=\"SITE/dbtools/gettempfile/export-database/{$f_url}/{$f}\">{$f}</a></p>";
Line 1225: $this->template('Export tables');
Line 1315: * @param string $source The source of the file, one of 'export-database', 'export-files', 'module-builder'
Line 1324: 'export-database' => '/^export-[0-9]+-(?:sql_[-0-9]+_.+\.zip|.+\.sql)$/',
Line 1325: 'export-files' => '/^files_[-0-9]+_.+\.zip$/',
Line 1375: * UI to export all files
Line 1377: public function exportFiles()
Line 1383: echo '<p>NOTE: Exports of many files may take a long time and/or fail.</p>';
Line 1385: echo '<form action="dbtools/exportFilesAction" method="post">';
Line 1387: echo '<div class="action-bar"><button type="submit" class="button">Export files</button></div>';
Line 1390: $this->template('Export files');
Line 1395: * Action to export all files
Line 1397: public function exportFilesAction()
Line 1430: echo "<div class=\"action-bar\"><a href=\"SITE/dbtools/gettempfile/export-files/{$name}\" class=\"button icon-after icon-save\">Download: {$name}</a></div>";
Line 1432: $this->template('Export files');
Line 2864: * Renders form to imoprt Sprout2 Export XML
Line 2879: * Process Sprout2 Export XML into this CMS
/sprout/Helpers/Export.php Highlighted file source
Line 16: class Export
Line 30: public function addTable(ExportTable $table)
Line 52: * Exports the specified tables to an SQL file
Line 55: public function exportSql()
Line 101: if ($table_def->data == ExportTableSQL::DATA_CSV) {
Line 113: } else if ($table_def->data != ExportTableSQL::DATA_NONE) {
Line 123: case ExportTableSQL::DATA_INSERT:
Line 128: case ExportTableSQL::DATA_UPDATE:
Line 133: case ExportTableSQL::DATA_BOTH:
Line 215: * Loads all of the generated export files into a ZIP file
/sprout/Helpers/Export.php Highlighted file source
Line 16: class Export
Line 30: public function addTable(ExportTable $table)
Line 52: * Exports the specified tables to an SQL file
Line 55: public function exportSql()
Line 101: if ($table_def->data == ExportTableSQL::DATA_CSV) {
Line 113: } else if ($table_def->data != ExportTableSQL::DATA_NONE) {
Line 123: case ExportTableSQL::DATA_INSERT:
Line 128: case ExportTableSQL::DATA_UPDATE:
Line 133: case ExportTableSQL::DATA_BOTH:
Line 215: * Loads all of the generated export files into a ZIP file
/sprout/Helpers/QueryTo.php Highlighted file source
Line 27: * Exports a database query result as a CSV file.
Line 29: * @param array $modifiers ColModifier objects to apply result set before exporting their values,
Line 98: * Exports a database query result as an XML file.
Line 101: * @param array $modifiers ColModifier objects to apply result set before exporting their values,
/sprout/Helpers/QueryTo.php Highlighted file source
Line 27: * Exports a database query result as a CSV file.
Line 29: * @param array $modifiers ColModifier objects to apply result set before exporting their values,
Line 98: * Exports a database query result as an XML file.
Line 101: * @param array $modifiers ColModifier objects to apply result set before exporting their values,
A total of 219 lines in 21 files were found