Skip to content

Remove ui-helpers link#29

Open
Mahinsa-Wattegedara wants to merge 1 commit intoPraveen-R-2518:mainfrom
Mahinsa-Wattegedara:main
Open

Remove ui-helpers link#29
Mahinsa-Wattegedara wants to merge 1 commit intoPraveen-R-2518:mainfrom
Mahinsa-Wattegedara:main

Conversation

@Mahinsa-Wattegedara
Copy link
Copy Markdown
Contributor

This pull request removes the shared UI helper functions for universities and inlines their logic directly into the relevant pages. The code for determining university image paths, locations, and descriptions has been moved from the deleted includes/ui-helpers.php file into universities.php and university.php, resulting in more explicit and page-specific logic. The most important changes are as follows:

Removal of shared helpers:

  • Deleted the includes/ui-helpers.php file, which previously contained helper functions for university image paths, locations, descriptions, and types. Calls to these functions were removed from universities.php and university.php. [1] [2] [3]

Image path logic refactoring:

  • In universities.php, the logic for selecting a university's image is now implemented inline, using a $universityImageMap and a series of fallback checks for image files, instead of the previous helper function. [1] [2]

Description and location logic refactoring:

  • The logic for generating university descriptions and locations is now handled directly in universities.php and university.php, including truncation and default values, instead of relying on helper functions. [1] [2] [3]

These changes increase code duplication but make the logic more visible and customizable within each page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant