diff --git a/public/images/org_recognized_student_2-1_example.png b/public/images/org_recognized_student_2-1_example.png new file mode 100644 index 0000000000000000000000000000000000000000..f97dc4fa0ede925b06a7c8d84565b581612f82ea Binary files /dev/null and b/public/images/org_recognized_student_2-1_example.png differ diff --git a/public/images/org_recognized_student_2-1_vert_example.png b/public/images/org_recognized_student_2-1_vert_example.png new file mode 100644 index 0000000000000000000000000000000000000000..57dc812ab20a21f67dfea8ade4d83576271c8fe9 Binary files /dev/null and b/public/images/org_recognized_student_2-1_vert_example.png differ diff --git a/public/images/org_recognized_student_example.png b/public/images/org_recognized_student_example.png index dba9eb6f414670800fd129e132ea25d171cc6689..5ff0d0bcd9b2b7ddaec07e1bb0a519d59a76b804 100644 Binary files a/public/images/org_recognized_student_example.png and b/public/images/org_recognized_student_example.png differ diff --git a/public/images/org_recognized_student_vert_example.png b/public/images/org_recognized_student_vert_example.png index c569733076cc47ae35ba011d11fa9b21c19d36b5..4dd85c714c8972fd75e3fa9be1f84c24063aa0d8 100644 Binary files a/public/images/org_recognized_student_vert_example.png and b/public/images/org_recognized_student_vert_example.png differ diff --git a/src/Controllers/LockupsController.php b/src/Controllers/LockupsController.php index d58b9f68bbf09779d62c354362010fc8c78f67db..aa7dc04b6ae945bc4a5c7e675fe5e5cb6b4cfadf 100644 --- a/src/Controllers/LockupsController.php +++ b/src/Controllers/LockupsController.php @@ -114,6 +114,10 @@ class LockupsController extends Controller { $valid = $valid && self::checkTextFieldLength($post_params, 'subject', 40); $valid = $valid && self::checkTextFieldLength($post_params, 'subject_second_line', 40); break; + case 'org_recognized_student_2_1': + $valid = $valid && self::checkTextFieldLength($post_params, 'organization', 31); + $valid = $valid && self::checkTextFieldLength($post_params, 'organization_second_line', 31); + break; case 'acronym': $valid = $valid && self::checkTextFieldLength($post_params, 'acronym', 10); break; @@ -297,6 +301,10 @@ class LockupsController extends Controller { $valid = $valid && self::checkTextFieldLength($post_params, 'subject', 40); $valid = $valid && self::checkTextFieldLength($post_params, 'subject_second_line', 40); break; + case 'org_recognized_student_2_1': + $valid = $valid && self::checkTextFieldLength($post_params, 'organization', 31); + $valid = $valid && self::checkTextFieldLength($post_params, 'organization_second_line', 31); + break; case 'acronym': $valid = $valid && self::checkTextFieldLength($post_params, 'acronym', 10); break; diff --git a/src/SvgGenerator.php b/src/SvgGenerator.php index 184f9df9304298e1ea5e0fe7f15560c1b429592c..94f1460eb090a4bd0df4ece08095943faf8fe474 100644 --- a/src/SvgGenerator.php +++ b/src/SvgGenerator.php @@ -48,6 +48,8 @@ class SvgGenerator { const CENTER_DIVIDER = "M51,0 L51,39 Z"; + const RECOGNIZED_STUDENT_ORGANIZATION = 'Recognized Student Organization'; + public static $lockup_templates_directory = __DIR__ . '/LockupTemplates'; public static function createPreviewLockup($template, $lockup, $orient = 'horiz') { @@ -219,8 +221,8 @@ class SvgGenerator { $svg->setLetterSpacing(0); $svg->setFontSize(8.125); $svg->setFontColor($secondary_text_color); - $svg->addText('Recognized Student Organization', 44, 26); - $secondary_text_width = $svg->textDimensions('Recognized Student Organization')[0]; + $svg->addText(self::RECOGNIZED_STUDENT_ORGANIZATION, 44, 26); + $secondary_text_width = $svg->textDimensions(self::RECOGNIZED_STUDENT_ORGANIZATION)[0]; $svg->addAttribute('viewBox', "0 0 " . (max($main_text_width, $secondary_text_width) + 44) . " 38"); $svg_file->height = 38; @@ -311,6 +313,32 @@ class SvgGenerator { $svg->addAttribute('width', max($main_text_width, $secondary_text_width, $third_width, $fourth_width) + 44); } break; + case 'org_recognized_student_2_1': + $svg->setFontSVG(self::TUNGSTEN); + $svg->setLetterSpacing(0.05); + $svg->setFontSize(12); + $svg->setFontColor($main_text_color); + $svg->addText($lockup->org_name, 44, -5.8); + $main_text_width = $svg->textDimensions($lockup->org_name)[0]; + + $svg->addText($lockup->org_second_line, 44, 5.2); + $third_width = $svg->textDimensions($lockup->org_second_line)[0]; + + $svg->setFontSVG(self::MERCURY); + $svg->setLetterSpacing(0); + $svg->setFontSize(8.125); + $svg->setFontColor($secondary_text_color); + $svg->addText(self::RECOGNIZED_STUDENT_ORGANIZATION, 44, 26); + $secondary_text_width = $svg->textDimensions(self::RECOGNIZED_STUDENT_ORGANIZATION)[0]; + + $svg->addAttribute('viewBox', "0 0 " . (max($main_text_width, $secondary_text_width, $third_width) + 44) . " 38"); + $svg_file->height = 38; + $svg_file->width = max($main_text_width, $secondary_text_width, $third_width) + 44; + if (!$preview) { + $svg->addAttribute('height', 38); + $svg->addAttribute('width', max($main_text_width, $secondary_text_width, $third_width) + 44); + } + break; case 'acronym': $svg->setFontSVG(self::TUNGSTEN); $svg->setLetterSpacing(0.05); @@ -451,8 +479,8 @@ class SvgGenerator { $svg->setLetterSpacing(0); $svg->setFontSize(8.125); $svg->setFontColor($secondary_text_color); - $text_width = $svg->textDimensions('Recognized Student Organization')[0]; - $svg->addText('Recognized Student Organization', 100 - ($text_width / 2), 55); + $text_width = $svg->textDimensions(self::RECOGNIZED_STUDENT_ORGANIZATION)[0]; + $svg->addText(self::RECOGNIZED_STUDENT_ORGANIZATION, 100 - ($text_width / 2), 55); break; case 'org_subject_1_2': $svg->setFontSVG(self::TUNGSTEN); @@ -511,6 +539,24 @@ class SvgGenerator { $text_width = $svg->textDimensions($lockup->subject_second_line)[0]; $svg->addText($lockup->subject_second_line, 100 - ($text_width / 2), 70); break; + case 'org_recognized_student_2_1': + $svg->setFontSVG(self::TUNGSTEN); + $svg->setLetterSpacing(0.05); + $svg->setFontSize(12); + $svg->setFontColor($main_text_color); + $text_width = $svg->textDimensions($lockup->org_name)[0]; + $svg->addText($lockup->org_name, 100 - ($text_width / 2), 37); + + $text_width = $svg->textDimensions($lockup->org_second_line)[0]; + $svg->addText($lockup->org_second_line, 100 - ($text_width / 2), 48); + + $svg->setFontSVG(self::MERCURY); + $svg->setLetterSpacing(0); + $svg->setFontSize(8.125); + $svg->setFontColor($secondary_text_color); + $text_width = $svg->textDimensions(self::RECOGNIZED_STUDENT_ORGANIZATION)[0]; + $svg->addText(self::RECOGNIZED_STUDENT_ORGANIZATION, 100 - ($text_width / 2), 66); + break; case 'acronym': $svg->setFontSVG(self::TUNGSTEN); $svg->setLetterSpacing(0.05); diff --git a/src/Views/new_lockup.php b/src/Views/new_lockup.php index ee36ed22882ec5b984b5cb9a0e4ecd6cbaa8da68..a0d51ce423aeb4f3386886d38c2d6dc465879952 100644 --- a/src/Views/new_lockup.php +++ b/src/Views/new_lockup.php @@ -74,7 +74,7 @@ <img class="vert" style="display: none;" src="<?php echo $context->baseURL; ?>images/org_recognized_student_vert_example.png" role="presentation"> </label><br> <label for="type-org-recognized-student"> - Recognized Student Organization lockup: primary and secondary hierarchy for your recognized student organization name in a single line design. + Recognized Student Organization lockup: primary hierarchy for your recognized student organization name in a single line design. </label> </div> <div> @@ -99,6 +99,17 @@ <br><em>*Additional line should be used when ID is too long to fit on one line.</em> </label> </div> + <div> + <label> + <input type="radio" name="type" value="org_recognized_student_2_1" id="type-org-recognized-student-2-1" <?php if ($context->lockup->style == 'org_recognized_student_2_1') echo 'checked="checked"'; ?>> + <img class="horiz height-38" src="<?php echo $context->baseURL; ?>images/org_recognized_student_2-1_example.png" role="presentation"> + <img class="vert" style="display: none;" src="<?php echo $context->baseURL; ?>images/org_recognized_student_2-1_vert_example.png" role="presentation"> + </label><br> + <label for="type-org-recognized-student-2-1"> + Recognized Student Organization lockup: primary hierarchy for your recognized student organization name in a two line design. + <br><em>*Additional line should be used when ID is too long to fit on one line.</em> + </label> + </div> <div> <label> <input type="radio" name="type" value="acronym" id="type-acronym" <?php if ($context->lockup->style == 'acronym') echo 'checked="checked"'; ?>> @@ -202,7 +213,7 @@ 31 characters max </div> </div> - <input class="dcf-input-text" type="text" name="organization_second_line" maxlength="31" id="organization-second-line"> + <input class="dcf-input-text" type="text" name="organization_second_line" maxlength="31" id="organization-second-line" value="<?php echo $context->lockup->organization_second_line; ?>"> </div> <div id="subject-field" style="display: none;"> <label for="subject">Subject</label> @@ -414,6 +425,15 @@ require(['jquery'], function ($) { $('#acronym-second-line-field').hide(); $('#acronym-subject-field').hide(); $('#extension-county-field').hide(); + } else if ($('#type-org-recognized-student-2-1').is(':checked')) { + $('#organization-field').show(); + $('#organization-second-line-field').show(); + $('#subject-field').hide(); + $('#subject-second-line-field').hide(); + $('#acronym-field').hide(); + $('#acronym-second-line-field').hide(); + $('#acronym-subject-field').hide(); + $('#extension-county-field').hide(); } else if ($('#type-acronym').is(':checked')) { $('#organization-field').hide(); $('#organization-second-line-field').hide();