Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make parameters more consistent... #189

Open
proseLA opened this issue Dec 31, 2022 · 2 comments
Open

make parameters more consistent... #189

proseLA opened this issue Dec 31, 2022 · 2 comments

Comments

@proseLA
Copy link

proseLA commented Dec 31, 2022

i'm not a fan of including the space here in the params key of the array:

# grepp params.....\'.class includes/modules/bootstrap/
includes/modules/bootstrap/centerboxes/new_products.php:87:            'params' => ' class="centerBoxContentsNew centerBoxContents card mb-3 p-3 text-center"',
includes/modules/bootstrap/centerboxes/specials_index.php:93:            'params' => ' class="centerBoxContentsSpecials centerBoxContents card mb-3 p-3 text-center"',
includes/modules/bootstrap/centerboxes/featured_products.php:87:            'params' => ' class="centerBoxContentsFeatured centerBoxContents card mb-3 p-3 text-center"',

these are the only 3 places where it is done.

i think it should be done in the writing out of the html similar to other elements.

in addition, these lines here:

$c_params = "";
if (isset($col['params'])) $c_params .= ' ' . (string)$col['params'];
if (isset($col['text'])) {
echo '<div' . $c_params . '>' . $col['text'] . '</div>';
}

might be improved to:

        if (isset($col['text'])) {
            echo '<div ' . $col['params'] ?? '' . '>' . $col['text'] .  '</div>';
        }

whether $col['params'] needs to be cast to a string, i have not investigated, but i think it should be unnecessary as well.

@lat9
Copy link
Owner

lat9 commented Dec 31, 2022

The issue, IMO, in what you've proposed is that you'd wind up with a <div > tag, noting the extra, invalid, space after div if the parameters were empty.

@proseLA
Copy link
Author

proseLA commented Mar 18, 2023

just re-looking at this for the fun of it. what makes you think the space after <div > is invalid html?

i looked at the validator here, and this code validated fine:

<!doctype html>
<html dir="ltr" lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Admin:  Index</title>
    <link rel="stylesheet" href="includes/css/bootstrap.min.css">
    <link rel="stylesheet" href="includes/css/font-awesome.min.css">
</head>
<body >
<div >
    <div >
        <i class="fa fa-2x fa-info-circle"></i> WARNING: ALL emails will be sent to [email protected] (as defined in &quot;DEVELOPER_OVERRIDE_EMAIL_ADDRESS&quot;).
    </div >
</div>
</body>
</html>

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

No branches or pull requests

2 participants