From d22e921a9d14f569c8982bb58b8f33b8532b2380 Mon Sep 17 00:00:00 2001 From: Justin Sternberg Date: Sun, 8 Feb 2015 00:01:43 -0500 Subject: [PATCH] Allow setting false for an attribute to be sure it's removed. Also add better wrap classes around files as well as images. Also add data-id attribute to files/images. --- includes/CMB2_Types.php | 2 +- languages/cmb2.pot | 41 ++++++++++++++++------------------------ tests/test-cmb-types.php | 9 ++++++++- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/includes/CMB2_Types.php b/includes/CMB2_Types.php index 51c3f427c..8d84c48ea 100644 --- a/includes/CMB2_Types.php +++ b/includes/CMB2_Types.php @@ -798,7 +798,7 @@ public function file_list() { $id_input = $this->input( array( 'type' => 'hidden', 'value' => $fullurl, - 'name' => $name . '[' . $id . ']' , + 'name' => $name . '[' . $id . ']', 'id' => 'filelist-' . $id, 'data-id' => $id, 'desc' => '', diff --git a/languages/cmb2.pot b/languages/cmb2.pot index 932cb3878..cf1259137 100644 --- a/languages/cmb2.pot +++ b/languages/cmb2.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: CMB2 2.0.2\n" "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/cmb2\n" -"POT-Creation-Date: 2015-02-15 01:52:24+00:00\n" +"POT-Creation-Date: 2015-02-15 01:52:34+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -301,7 +301,7 @@ msgstr "" msgid "Please Try Again" msgstr "" -#: includes/CMB2_Ajax.php:133 tests/test-cmb-types.php:763 +#: includes/CMB2_Ajax.php:133 msgid "Remove Embed" msgstr "" @@ -329,10 +329,8 @@ msgstr "" msgid "Add Row" msgstr "" -#: includes/CMB2_Types.php:351 includes/CMB2_Types.php:821 -#: includes/CMB2_Types.php:900 includes/CMB2_hookup.php:179 +#: includes/CMB2_Types.php:351 includes/CMB2_hookup.php:179 #: tests/test-cmb-types.php:147 tests/test-cmb-types.php:155 -#: tests/test-cmb-types.php:712 tests/test-cmb-types.php:737 msgid "Remove" msgstr "" @@ -340,29 +338,10 @@ msgstr "" msgid "No terms" msgstr "" -#: includes/CMB2_Types.php:789 includes/CMB2_Types.php:847 -#: tests/test-cmb-types.php:688 tests/test-cmb-types.php:714 -#: tests/test-cmb-types.php:724 tests/test-cmb-types.php:739 +#: includes/CMB2_Types.php:789 tests/test-cmb-types.php:688 msgid "Add or Upload File" msgstr "" -#: includes/CMB2_Types.php:812 includes/CMB2_Types.php:895 -#: includes/CMB2_hookup.php:178 -msgid "Remove Image" -msgstr "" - -#: includes/CMB2_Types.php:821 includes/CMB2_Types.php:900 -#: includes/CMB2_hookup.php:180 tests/test-cmb-types.php:713 -#: tests/test-cmb-types.php:738 -msgid "File:" -msgstr "" - -#: includes/CMB2_Types.php:821 includes/CMB2_Types.php:900 -#: includes/CMB2_hookup.php:181 tests/test-cmb-types.php:711 -#: tests/test-cmb-types.php:736 -msgid "Download" -msgstr "" - #: includes/CMB2_hookup.php:129 includes/CMB2_hookup.php:166 msgid "Clear" msgstr "" @@ -425,6 +404,18 @@ msgstr "" msgid "Use this file" msgstr "" +#: includes/CMB2_hookup.php:178 +msgid "Remove Image" +msgstr "" + +#: includes/CMB2_hookup.php:180 +msgid "File:" +msgstr "" + +#: includes/CMB2_hookup.php:181 +msgid "Download" +msgstr "" + #: includes/CMB2_hookup.php:182 msgid "Select / Deselect All" msgstr "" diff --git a/tests/test-cmb-types.php b/tests/test-cmb-types.php index 0ce6e1f8e..96981304f 100644 --- a/tests/test-cmb-types.php +++ b/tests/test-cmb-types.php @@ -704,7 +704,14 @@ public function test_file_list_field_after_value_update() { ) ); $this->assertHTMLstringsAreEqual( - sprintf( '

This is a description

', + sprintf( ' + + +

This is a description

+ ', $this->attachment_id, $this->attachment_id2, site_url(),