AntonLV 6 лет назад
Родитель
Сommit
e456e1cc5b

+ 3 - 0
modules/base/files/classes/BxBaseModFilesFormUpload.php

@@ -19,6 +19,9 @@ class BxBaseModFilesFormUpload extends BxBaseModTextFormEntry
         parent::__construct($aInfo, $oTemplate);
 
         $this->_sGhostTemplate = 'form_ghost_template_upload.html';
+
+        if (isset($this->aInputs['profile_id']))
+            $this->aInputs['profile_id']['value'] = bx_get('profile_id');
     }
 
     public function insert ($aValsToAdd = array(), $isIgnore = false)

+ 1 - 0
modules/boonex/files/install/langs/en.xml

@@ -19,6 +19,7 @@
 	<string name="_bx_files_form_entry_display_delete"><![CDATA[Delete File]]></string>
 	<string name="_bx_files_form_entry_display_view"><![CDATA[View File]]></string>
 	<string name="_bx_files_form_entry_input_author"><![CDATA[Author]]></string>
+        <string name="_bx_files_form_entry_input_sys_profile_id"><![CDATA[Profile ID]]></string>
 	<string name="_bx_files_form_entry_input_sys_do_submit"><![CDATA[Submit]]></string>
 	<string name="_bx_files_form_entry_input_do_submit"><![CDATA[Submit]]></string>
 	<string name="_bx_files_form_entry_input_sys_do_publish"><![CDATA[Publish]]></string>

+ 7 - 5
modules/boonex/files/install/sql/install.sql

@@ -246,7 +246,8 @@ INSERT INTO `sys_form_inputs`(`object`, `module`, `name`, `value`, `values`, `ch
 ('bx_files_upload', 'bx_files', 'attachments', 'a:1:{i:0;s:14:"bx_files_html5";}', 'a:2:{s:15:"bx_files_simple";s:26:"_sys_uploader_simple_title";s:14:"bx_files_html5";s:25:"_sys_uploader_html5_title";}', 0, 'files', '_bx_files_form_entry_input_sys_attachments', '_bx_files_form_entry_input_attachments', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_files_form_entry_input_attachments', '', '', 1, 0),
 ('bx_files_upload', 'bx_files', 'cat', '', '#!bx_files_cats', 0, 'select', '_bx_files_form_entry_input_sys_cat', '_bx_files_form_entry_input_cat', '', 1, 0, 0, '', '', '', 'avail', '', '_bx_files_form_entry_input_cat_err', 'Xss', '', 1, 0),
 ('bx_files_upload', 'bx_files', 'allow_view_to', '', '', 0, 'custom', '_bx_files_form_entry_input_sys_allow_view_to', '_bx_files_form_entry_input_allow_view_to', '', 1, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
-('bx_files_upload', 'bx_files', 'do_submit', '_bx_files_form_entry_input_do_submit', '', 0, 'submit', '_bx_files_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0);
+('bx_files_upload', 'bx_files', 'do_submit', '_bx_files_form_entry_input_do_submit', '', 0, 'submit', '_bx_files_form_entry_input_sys_do_submit', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 1, 0),
+('bx_files_upload', 'bx_files', 'profile_id', '0', '', 0, 'hidden', '_bx_files_form_entry_input_sys_profile_id', '', '', 0, 0, 0, '', '', '', '', '', '', '', '', 0, 0);
 
 INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for_levels`, `active`, `order`) VALUES 
 ('bx_files_entry_delete', 'delete_confirm', 2147483647, 1, 1),
@@ -264,10 +265,11 @@ INSERT INTO `sys_form_display_inputs`(`display_name`, `input_name`, `visible_for
 ('bx_files_entry_view', 'added', 2147483647, 1, 2),
 ('bx_files_entry_view', 'changed', 2147483647, 1, 3),
 
-('bx_files_entry_upload', 'attachments', 2147483647, 1, 1),
-('bx_files_entry_upload', 'cat', 2147483647, 1, 2),
-('bx_files_entry_upload', 'allow_view_to', 2147483647, 1, 3),
-('bx_files_entry_upload', 'do_submit', 2147483647, 1, 4);
+('bx_files_entry_upload', 'profile_id', 2147483647, 1, 1),
+('bx_files_entry_upload', 'attachments', 2147483647, 1, 2),
+('bx_files_entry_upload', 'cat', 2147483647, 1, 3),
+('bx_files_entry_upload', 'allow_view_to', 2147483647, 1, 4),
+('bx_files_entry_upload', 'do_submit', 2147483647, 1, 5);
 
 -- PRE-VALUES
 INSERT INTO `sys_form_pre_lists`(`key`, `title`, `module`, `use_for_sets`) VALUES

+ 1 - 0
modules/boonex/russian/data/langs/bx_files/ru.xml

@@ -19,6 +19,7 @@
 	<string name="_bx_files_form_entry_display_delete"><![CDATA[Удаление файла]]></string>
 	<string name="_bx_files_form_entry_display_view"><![CDATA[Просмотр файла]]></string>
 	<string name="_bx_files_form_entry_input_author"><![CDATA[Автор]]></string>
+        <string name="_bx_files_form_entry_input_sys_profile_id"><![CDATA[ID профайла]]></string>
 	<string name="_bx_files_form_entry_input_sys_do_submit"><![CDATA[Опубликовать]]></string>
 	<string name="_bx_files_form_entry_input_do_submit"><![CDATA[Опубликовать]]></string>
 	<string name="_bx_files_form_entry_input_sys_do_publish"><![CDATA[Опубликовать]]></string>