aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-02-02 16:20:02 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-02-02 16:20:02 +0100
commitcbad102f88d285ae64e65bf10cddfdf2c615f138 (patch)
tree1a1ac71d3130c8ef756edd600ed5d24271bedf7e /phpBB
parentcacd43bfbd547d711bfdd4c424adfef9d20528e7 (diff)
downloadforums-cbad102f88d285ae64e65bf10cddfdf2c615f138.tar
forums-cbad102f88d285ae64e65bf10cddfdf2c615f138.tar.gz
forums-cbad102f88d285ae64e65bf10cddfdf2c615f138.tar.bz2
forums-cbad102f88d285ae64e65bf10cddfdf2c615f138.tar.xz
forums-cbad102f88d285ae64e65bf10cddfdf2c615f138.zip
[ticket/11201] Split template file into multiple files
PHPBB3-11201
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/phpbb/profilefields/type/type_base.php12
-rw-r--r--phpBB/styles/prosilver/template/custom_profile_fields.html31
-rw-r--r--phpBB/styles/prosilver/template/profilefields/bool.html7
-rw-r--r--phpBB/styles/prosilver/template/profilefields/date.html5
-rw-r--r--phpBB/styles/prosilver/template/profilefields/dropdown.html5
-rw-r--r--phpBB/styles/prosilver/template/profilefields/int.html3
-rw-r--r--phpBB/styles/prosilver/template/profilefields/string.html3
-rw-r--r--phpBB/styles/prosilver/template/profilefields/text.html3
8 files changed, 36 insertions, 33 deletions
diff --git a/phpBB/phpbb/profilefields/type/type_base.php b/phpBB/phpbb/profilefields/type/type_base.php
index 248a89e5ac..95e9b8768b 100644
--- a/phpBB/phpbb/profilefields/type/type_base.php
+++ b/phpBB/phpbb/profilefields/type/type_base.php
@@ -63,6 +63,14 @@ abstract class type_base implements type_interface
/**
* {@inheritDoc}
*/
+ public function get_template_filename()
+ {
+ return 'profilefields/' . $this->get_name_short() . '.html';
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public function get_field_ident($field_data)
{
return 'pf_' . $field_data['field_ident'];
@@ -153,7 +161,7 @@ abstract class type_base implements type_interface
// set template filename
$this->template->set_filenames(array(
- 'cp_' . $this->get_name_short() . '_body' => 'custom_profile_fields.html',
+ 'cp_body' => $this->get_template_filename(),
));
// empty previously filled blockvars
@@ -162,6 +170,6 @@ abstract class type_base implements type_interface
// Assign template variables
$this->generate_field($profile_row, $preview_options);
- return $this->template->assign_display('cp_' . $this->get_name_short() . '_body');
+ return $this->template->assign_display('cp_body');
}
}
diff --git a/phpBB/styles/prosilver/template/custom_profile_fields.html b/phpBB/styles/prosilver/template/custom_profile_fields.html
deleted file mode 100644
index 764cac7b3a..0000000000
--- a/phpBB/styles/prosilver/template/custom_profile_fields.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!-- BEGIN dropdown -->
-<select name="{dropdown.FIELD_IDENT}" id="{dropdown.FIELD_IDENT}">
- <!-- BEGIN options --><option value="{dropdown.options.OPTION_ID}"{dropdown.options.SELECTED}>{dropdown.options.VALUE}</option><!-- END options -->
-</select>
-<!-- END dropdown -->
-
-<!-- BEGIN text -->
-<textarea name="{text.FIELD_IDENT}" id="{text.FIELD_IDENT}" rows="{text.FIELD_ROWS}" cols="{text.FIELD_COLS}" class="inputbox">{text.FIELD_VALUE}</textarea>
-<!-- END text -->
-
-<!-- BEGIN string -->
-<input type="text" class="inputbox autowidth" name="{string.FIELD_IDENT}" id="{string.FIELD_IDENT}" size="{string.FIELD_LENGTH}" maxlength="{string.FIELD_MAXLEN}" value="{string.FIELD_VALUE}" />
-<!-- END string -->
-
-<!-- BEGIN bool -->
-<!-- IF bool.FIELD_LENGTH eq 1 -->
- <!-- BEGIN options --><label for="{bool.FIELD_IDENT}_{bool.options.OPTION_ID}"><input type="radio" class="radio" name="{bool.FIELD_IDENT}" id="{bool.FIELD_IDENT}_{bool.options.OPTION_ID}" value="{bool.options.OPTION_ID}"{bool.options.CHECKED} /> {bool.options.VALUE}</label> <!-- END options -->
-<!-- ELSE -->
- <input type="checkbox" class="radio" name="{bool.FIELD_IDENT}" id="{bool.FIELD_IDENT}"<!-- IF bool.FIELD_VALUE --> checked="checked"<!-- ENDIF --> />
-<!-- ENDIF -->
-<!-- END bool -->
-
-<!-- BEGIN int -->
-<input type="number" min="{int.FIELD_MINLEN}" max="{int.FIELD_MAXLEN}" class="inputbox autowidth" name="{int.FIELD_IDENT}" id="{int.FIELD_IDENT}" size="{int.FIELD_LENGTH}" value="{int.FIELD_VALUE}" />
-<!-- END int -->
-
-<!-- BEGIN date -->
-<label for="{date.FIELD_IDENT}_day">{L_DAY}{L_COLON} <select name="{date.FIELD_IDENT}_day" id="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select></label>
-<label for="{date.FIELD_IDENT}_month">{L_MONTH}{L_COLON} <select name="{date.FIELD_IDENT}_month" id="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select></label>
-<label for="{date.FIELD_IDENT}_year">{L_YEAR}{L_COLON} <select name="{date.FIELD_IDENT}_year" id="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select></label>
-<!-- END date -->
diff --git a/phpBB/styles/prosilver/template/profilefields/bool.html b/phpBB/styles/prosilver/template/profilefields/bool.html
new file mode 100644
index 0000000000..f1d7ba75f4
--- /dev/null
+++ b/phpBB/styles/prosilver/template/profilefields/bool.html
@@ -0,0 +1,7 @@
+<!-- BEGIN bool -->
+<!-- IF bool.FIELD_LENGTH eq 1 -->
+ <!-- BEGIN options --><label for="{bool.FIELD_IDENT}_{bool.options.OPTION_ID}"><input type="radio" class="radio" name="{bool.FIELD_IDENT}" id="{bool.FIELD_IDENT}_{bool.options.OPTION_ID}" value="{bool.options.OPTION_ID}"{bool.options.CHECKED} /> {bool.options.VALUE}</label> <!-- END options -->
+<!-- ELSE -->
+ <input type="checkbox" class="radio" name="{bool.FIELD_IDENT}" id="{bool.FIELD_IDENT}"<!-- IF bool.FIELD_VALUE --> checked="checked"<!-- ENDIF --> />
+<!-- ENDIF -->
+<!-- END bool -->
diff --git a/phpBB/styles/prosilver/template/profilefields/date.html b/phpBB/styles/prosilver/template/profilefields/date.html
new file mode 100644
index 0000000000..5d5bc04ed6
--- /dev/null
+++ b/phpBB/styles/prosilver/template/profilefields/date.html
@@ -0,0 +1,5 @@
+<!-- BEGIN date -->
+<label for="{date.FIELD_IDENT}_day">{L_DAY}{L_COLON} <select name="{date.FIELD_IDENT}_day" id="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select></label>
+<label for="{date.FIELD_IDENT}_month">{L_MONTH}{L_COLON} <select name="{date.FIELD_IDENT}_month" id="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select></label>
+<label for="{date.FIELD_IDENT}_year">{L_YEAR}{L_COLON} <select name="{date.FIELD_IDENT}_year" id="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select></label>
+<!-- END date -->
diff --git a/phpBB/styles/prosilver/template/profilefields/dropdown.html b/phpBB/styles/prosilver/template/profilefields/dropdown.html
new file mode 100644
index 0000000000..243b7039da
--- /dev/null
+++ b/phpBB/styles/prosilver/template/profilefields/dropdown.html
@@ -0,0 +1,5 @@
+<!-- BEGIN dropdown -->
+<select name="{dropdown.FIELD_IDENT}" id="{dropdown.FIELD_IDENT}">
+ <!-- BEGIN options --><option value="{dropdown.options.OPTION_ID}"{dropdown.options.SELECTED}>{dropdown.options.VALUE}</option><!-- END options -->
+</select>
+<!-- END dropdown -->
diff --git a/phpBB/styles/prosilver/template/profilefields/int.html b/phpBB/styles/prosilver/template/profilefields/int.html
new file mode 100644
index 0000000000..a6f9a0a49e
--- /dev/null
+++ b/phpBB/styles/prosilver/template/profilefields/int.html
@@ -0,0 +1,3 @@
+<!-- BEGIN int -->
+<input type="number" min="{int.FIELD_MINLEN}" max="{int.FIELD_MAXLEN}" class="inputbox autowidth" name="{int.FIELD_IDENT}" id="{int.FIELD_IDENT}" size="{int.FIELD_LENGTH}" value="{int.FIELD_VALUE}" />
+<!-- END int -->
diff --git a/phpBB/styles/prosilver/template/profilefields/string.html b/phpBB/styles/prosilver/template/profilefields/string.html
new file mode 100644
index 0000000000..cf457d39ad
--- /dev/null
+++ b/phpBB/styles/prosilver/template/profilefields/string.html
@@ -0,0 +1,3 @@
+<!-- BEGIN string -->
+<input type="text" class="inputbox autowidth" name="{string.FIELD_IDENT}" id="{string.FIELD_IDENT}" size="{string.FIELD_LENGTH}" maxlength="{string.FIELD_MAXLEN}" value="{string.FIELD_VALUE}" />
+<!-- END string -->
diff --git a/phpBB/styles/prosilver/template/profilefields/text.html b/phpBB/styles/prosilver/template/profilefields/text.html
new file mode 100644
index 0000000000..f54c63925c
--- /dev/null
+++ b/phpBB/styles/prosilver/template/profilefields/text.html
@@ -0,0 +1,3 @@
+<!-- BEGIN text -->
+<textarea name="{text.FIELD_IDENT}" id="{text.FIELD_IDENT}" rows="{text.FIELD_ROWS}" cols="{text.FIELD_COLS}" class="inputbox">{text.FIELD_VALUE}</textarea>
+<!-- END text -->