mambax7 / tag

The Tag module is designed for site-wide tag management, handling tag input, display and stats for each module that enables tag plugin.
2 stars 3 forks source link

Cosmetic on blockamdin page - space link #19

Closed alain01 closed 2 years ago

alain01 commented 2 years ago

Hi I didn't find the blockadmin template, I did see the php file (/admin/blocksadmin.php) but I can't change it.

The problem is the space link between 2 links Capture d’écran 2021-12-17 094907

Sorry, I want to propose PR but I dont know if there is no templates. I see the code

       if ('edit' === $op) {
            $blocksadmin->editBlock($bid);
        }

and

        if ('clone' === $op) {
            $blocksadmin->cloneBlock($bid);
        }

but I don't know what to do with it...

mambax7 commented 2 years ago

Look in: https://github.com/mambax7/tag/blob/master/class/Common/Blocksadmin.php

mambax7 commented 2 years ago

If you want to extract all the HTML/CSS code and make it a real Smarty template, please do - it would be awesome :)
You can then place it in /templates/class/common/

alain01 commented 2 years ago

haaaaa ok ! I understand now ! The construction of the file is done here! Ok, I'm working on it... 2 times hehe, 1 time to correct the problem Then 1 time to try to turn in real template

Another question linked: How could I guess that the rendering construction was done in class/common/Blockadmin.php? I don't see any reference in /admin/blocksadmin.php

If you want to extract all the HTML/CSS code and make it a real Smarty template, please do - it would be awesome :) You can then place it in /templates/class/common/ I need an example to understand how to "call" the file. Not for the template, but the code to call this template and where to put this code. And I believed admin templates were in /templates/admin, no ?

Humm, A lot of new concepts for me, but yes, I am willing to help. I know it's taking you a while to explain, so do what you can.

mambax7 commented 2 years ago

You need to pay attention to the namespaces, which are indicated in this case by the "use" word:

use XoopsModules\Tag\{
    Common\Blocksadmin,
    Helper
};

Here we are saying that we want to use "our" namespace, i.e. "XoopsModules\Tag\" which points to the /class folder (that's our convention).

We're also saying that within this namespace, we want to use classes from these files:

/Common/Blocksadmin.php
/Helper.php

which translates to:

/modules/tag/class/Common/Blocksadmin.php
/modules/tag/class/Helper.php

And then, when we say:

$blocksadmin = new Blocksadmin($xoopsDB, $helper);

we are instantiating the class Blocksadmin and use it.

If you want to understand more the concept of Namespaces, you can read some of the tutorials:

https://www.sitepoint.com/php-53-namespaces-basics/

https://www.phptutorial.net/php-oop/php-namespace/

https://code.tutsplus.com/tutorials/php-namespace-tutorial-the-basics--cms-35583

https://www.thoughtfulcode.com/a-complete-guide-to-php-namespaces/

alain01 commented 2 years ago

closed by this merge https://github.com/mambax7/tag/pull/20