2021-12-14 18:32:47 +00:00
< ? php
declare ( strict_types = 1 );
2007-06-30 01:19:11 +00:00
2023-01-10 22:44:09 +00:00
namespace Shimmie2 ;
2023-07-10 18:03:54 +00:00
use MicroHTML\HTMLElement ;
use function MicroHTML\emptyHTML ;
2024-06-13 04:07:35 +00:00
use function MicroHTML\rawHTML ;
use function MicroHTML\ { BR , CODE , INPUT };
2023-07-10 18:03:54 +00:00
2019-05-28 16:59:38 +00:00
class AliasEditorTheme extends Themelet
{
/**
* Show a page of aliases .
*/
2023-07-10 18:03:54 +00:00
public function display_aliases ( HTMLElement $table , HTMLElement $paginator ) : void
2019-05-28 16:59:38 +00:00
{
global $page , $user ;
2012-02-07 15:15:18 +00:00
2024-06-13 04:07:35 +00:00
$info_html = rawHTML ( " A tag alias replaces a tag with another tag or tags. " . BR () . " A tag implication (where the old tag stays and adds a new tag) is made by including the old tag in the list of new tags ( " . CODE ( " fox " ) . " → " . CODE ( " fox canine " ) . " ) " . BR ());
$html = emptyHTML ( $info_html , BR (), $table , BR (), $paginator , BR (), SHM_A ( " alias/export/aliases.csv " , " Download as CSV " , args : [ " download " => " aliases.csv " ]));
2009-08-03 09:24:32 +00:00
2023-07-10 18:03:54 +00:00
$bulk_form = SHM_FORM ( " alias/import " , multipart : true );
$bulk_form -> appendChild (
2023-11-11 21:49:12 +00:00
INPUT ([ " type " => " file " , " name " => " alias_file " ]),
2023-07-10 18:03:54 +00:00
SHM_SUBMIT ( " Upload List " )
);
$bulk_html = emptyHTML ( $bulk_form );
2009-01-04 19:18:37 +00:00
2019-05-28 16:59:38 +00:00
$page -> set_title ( " Alias List " );
$page -> set_heading ( " Alias List " );
$page -> add_block ( new NavBlock ());
$page -> add_block ( new Block ( " Aliases " , $html ));
2023-07-10 18:03:54 +00:00
if ( $user -> can ( Permissions :: MANAGE_ALIAS_LIST )) {
2019-05-28 16:59:38 +00:00
$page -> add_block ( new Block ( " Bulk Upload " , $bulk_html , " main " , 51 ));
}
}
2007-06-30 01:19:11 +00:00
}