17 require_once SQ_SYSTEM_ROOT.
'/core/assets/system/tool/tool.inc';
44 parent::__construct($assetid);
64 $tool_info = $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($type_code);
66 $am = $GLOBALS[
'SQ_SYSTEM']->am;
67 $itm = $am->getSystemAsset(
'import_tools_manager');
69 $save_name = $itm->attr(
'cms_file_export_name');
70 $save_location = $itm->attr(
'cms_file_export_dir');
72 $o->openSection($tool_info[
'name']);
74 $o->openField(translate(
'cms_tool_export_files_root_node'));
75 multiple_asset_finder($type_code.
'_root_node', Array(), $filetypes);
76 $o->note(translate(
'cms_tool_export_files_root_node_note'));
79 $o->openField(translate(
'cms_tool_export_files_save_name'));
80 text_box($type_code.
'_save_name', $save_name, 30);
81 $o->note(translate(
'cms_tool_export_files_save_name_note'));
84 $o->openField(translate(
'cms_tool_export_files_save_location'));
85 text_box($type_code.
'_save_location', $save_location, 30);
86 $o->note(translate(
'cms_tool_export_files_save_location_note'));
89 $o->openField(translate(
'cms_tool_export_files_keep_structure'));
90 check_box($type_code.
'_keep', 1, TRUE);
91 $o->note(translate(
'cms_tool_export_files_keep_structure_note'));
111 if (!isset($_REQUEST[$type_code.
'_root_node']) || empty($_REQUEST[$type_code.
'_root_node'])) {
112 trigger_localised_error(
'CMS0100', E_USER_NOTICE);
117 if (!isset($_REQUEST[$type_code.
'_save_name']) || empty($_REQUEST[$type_code.
'_save_name'])) {
118 trigger_localised_error(
'CMS0101', E_USER_NOTICE);
123 if (!isset($_REQUEST[$type_code.
'_save_location']) || empty($_REQUEST[$type_code.
'_save_location'])) {
124 trigger_localised_error(
'CMS0102', E_USER_NOTICE);
129 if (!is_dir($_REQUEST[$type_code.
'_save_location']) || !is_writable($_REQUEST[$type_code.
'_save_location'])) {
130 trigger_localised_error(
'CMS0103', E_USER_NOTICE);
135 $vars[
'root_node'] = $_REQUEST[$type_code.
'_root_node'];
136 $vars[
'save_name'] = $_REQUEST[$type_code.
'_save_name'];
137 $vars[
'save_location'] = $_REQUEST[$type_code.
'_save_location'];
138 $vars[
'keep_structure'] = (isset($_REQUEST[$type_code.
'_keep']) && $_REQUEST[$type_code.
'_keep']) ? TRUE : FALSE;
141 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
142 $hh->queueHipo(
'hipo_job_tool_export_files', $vars,
'', SQ_PACKAGES_PATH.
'/cms/hipo_jobs');
143 $url = $hh->runQueuedJobs();
144 if (!empty($url)) $o->setRedirect($url);