diff --git a/includes/class-CategoryYearMonthDayType.php b/includes/class-CategoryYearMonthDayType.php new file mode 100644 index 0000000..f391125 --- /dev/null +++ b/includes/class-CategoryYearMonthDayType.php @@ -0,0 +1,66 @@ +. + +namespace itwikidelbot; + +/** + * Handle a daily category with a specified PDC type + * + * e.g. https://it.wikipedia.org/wiki/Categoria:Cancellazioni_consensuali_del_13_aprile_2018 + */ +abstract class CategoryYearMonthDayType extends CategoryYearMonthDay { + + /** + * Template name of this category + * + * @override CategoryTemplated::TEMPLATE_NAME + */ + const TEMPLATE_NAME = 'CATEGORY_DAY_PDCTYPE'; + + /** + * PDC type e.g. 'consensuale' + * + * To be overrided + */ + const PDC_TYPE = 'EXAMPLE'; + + /** + * Get the PDC type + * + * @return string e.g. 'consensuale' + */ + public function getPDCType() { + return static::PDC_TYPE; + } + + /** + * Get template arguments + * + * @override CategoryTemplated::getTemplateArguments() + */ + public function getTemplateArguments() { + $parent_arguments = parent::getTemplateArguments(); + $parent_arguments[] = $this->getPDCType(); + return $parent_arguments; + } +} diff --git a/includes/class-CategoryYearMonthDayTypeConsensual.php b/includes/class-CategoryYearMonthDayTypeConsensual.php new file mode 100644 index 0000000..71b531c --- /dev/null +++ b/includes/class-CategoryYearMonthDayTypeConsensual.php @@ -0,0 +1,39 @@ +. + +namespace itwikidelbot; + +/** + * Handle a daily consensual PDC category + * + * e.g. https://it.wikipedia.org/wiki/Categoria:Cancellazioni_consensuali_del_13_aprile_2018 + */ +class CategoryYearMonthDayTypeConsensual extends CategoryYearMonthDayType { + + /** + * PDC type + * + * @override CategoryYearMonthDayType::PDC_TYPE + */ + const PDC_TYPE = 'consensuale'; +} diff --git a/includes/class-CategoryYearMonthDayTypeOrdinary.php b/includes/class-CategoryYearMonthDayTypeOrdinary.php new file mode 100644 index 0000000..d71e4d0 --- /dev/null +++ b/includes/class-CategoryYearMonthDayTypeOrdinary.php @@ -0,0 +1,39 @@ +. + +namespace itwikidelbot; + +/** + * Handle a daily ordinary PDC category + * + * e.g. https://it.wikipedia.org/wiki/Categoria:Cancellazioni_ordinarie_del_25_giugno_2012 + */ +class CategoryYearMonthDayTypeOrdinary extends CategoryYearMonthDayType { + + /** + * PDC type + * + * @override CategoryYearMonthDayType::PDC_TYPE + */ + const PDC_TYPE = 'ordinarie'; +} diff --git a/includes/class-CategoryYearMonthDayTypeProlonged.php b/includes/class-CategoryYearMonthDayTypeProlonged.php new file mode 100644 index 0000000..adf6e1c --- /dev/null +++ b/includes/class-CategoryYearMonthDayTypeProlonged.php @@ -0,0 +1,39 @@ +. + +namespace itwikidelbot; + +/** + * Handle a daily prolonged PDC category + * + * e.g. https://it.wikipedia.org/wiki/Categoria:Cancellazioni_consensuali_prorogate_del_11_aprile_2018 + */ +class CategoryYearMonthDayTypeProlonged extends CategoryYearMonthDayType { + + /** + * PDC type + * + * @override CategoryYearMonthDayType::PDC_TYPE + */ + const PDC_TYPE = 'prorogate'; +} diff --git a/includes/class-CategoryYearMonthDayTypeVoting.php b/includes/class-CategoryYearMonthDayTypeVoting.php new file mode 100644 index 0000000..1955517 --- /dev/null +++ b/includes/class-CategoryYearMonthDayTypeVoting.php @@ -0,0 +1,39 @@ +. + +namespace itwikidelbot; + +/** + * Handle a daily voting PDC category + * + * e.g. https://it.wikipedia.org/wiki/Categoria:Cancellazioni_del_12_aprile_2018 + */ +class CategoryYearMonthDayTypeVoting extends CategoryYearMonthDayType { + + /** + * PDC type + * + * @override CategoryYearMonthDayType::PDC_TYPE + */ + const PDC_TYPE = 'con votazione'; +} diff --git a/templates/CATEGORY_DAY_PDCTYPE.content.tpl b/templates/CATEGORY_DAY_PDCTYPE.content.tpl new file mode 100644 index 0000000..9047ee3 --- /dev/null +++ b/templates/CATEGORY_DAY_PDCTYPE.content.tpl @@ -0,0 +1,22 @@ + +This is the template for the content of a daily subcategory. + +Placeholders: + %1$s: category title + %2$d: year + %3$d: month 1-12 + %3$02d: month 01-12 + %4$s: month name + %5$d: day 1-31 + %5$02d: day 01-31 + %6$s: PDC type + + +{{Cancellazione/cat|2018/4/13}} + +[[Categoria:Cancellazioni del 13 aprile 2018| consensuale]] + + +{{Cancellazione/cat|%2$d/%3$d/%5$d}} + +[[Categoria:Cancellazioni del %5$d %4$s %2$d| %6$s]] diff --git a/templates/CATEGORY_DAY_PDCTYPE.summary.tpl b/templates/CATEGORY_DAY_PDCTYPE.summary.tpl new file mode 100644 index 0000000..ecc288f --- /dev/null +++ b/templates/CATEGORY_DAY_PDCTYPE.summary.tpl @@ -0,0 +1,18 @@ + +This is the template for the edit summary of a daily subcategory. + +Placeholders: + %1$s: category title + %2$d: year + %3$d: month 1-12 + %3$02d: month 01-12 + %4$s: month name + %5$d: day 1-31 + %5$02d: day 01-31 + %6$s: PDC type + + +Bot: creazione categoria di servizio giornaliera per PDC tipo consensuale del 19 aprile 2018 + + +Bot: creazione categoria di servizio giornaliera per PDC tipo %6$s del %5$d %4$s %2$d diff --git a/templates/CATEGORY_DAY_PDCTYPE.title.tpl b/templates/CATEGORY_DAY_PDCTYPE.title.tpl new file mode 100644 index 0000000..837e8be --- /dev/null +++ b/templates/CATEGORY_DAY_PDCTYPE.title.tpl @@ -0,0 +1,18 @@ + +This is the template for the title of a specific PDC type daily category. + +Placeholders: + %1$s: category title + %2$d: year + %3$d: month 1-12 + %3$02d: month 01-12 + %4$s: month name + %5$d: day 1-31 + %5$02d: day 01-31 + %6$s: PDC type + + +Categoria:Cancellazioni ordinarie del 19 aprile 2018 + + +Categoria:Cancellazioni %6$s del %5$d %4$s %2$d