From b231450ff551232e0c4708c16d6cd337d5c79cec Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 19 Oct 2023 14:35:12 +0200 Subject: [PATCH] course supprime le titre long nom du module Workshop --- core/class/layout.class.php | 2 +- core/module/course/course.php | 13 +++++----- core/module/course/view/edit/edit.php | 12 ++-------- .../view/config/config.css | 0 .../view/config/config.php | 19 +++++---------- .../view/index/index.php | 24 +++++++++++-------- .../courses.php => workshop/workshop.php} | 7 +++--- 7 files changed, 32 insertions(+), 45 deletions(-) rename module/{courses => workshop}/view/config/config.css (100%) rename module/{courses => workshop}/view/config/config.php (86%) rename module/{courses => workshop}/view/index/index.php (69%) rename module/{courses/courses.php => workshop/workshop.php} (91%) diff --git a/core/class/layout.class.php b/core/class/layout.class.php index 595852c..f70c31d 100644 --- a/core/class/layout.class.php +++ b/core/class/layout.class.php @@ -904,7 +904,7 @@ class layout extends common $leftItems .= '
  • '; } diff --git a/core/module/course/course.php b/core/module/course/course.php index c963284..3681be4 100644 --- a/core/module/course/course.php +++ b/core/module/course/course.php @@ -70,7 +70,7 @@ class course extends common public function index() { - $courseIdShortTitle = helper::arrayColumn($this->getData(['course']), 'shortTitle'); + $courseIdShortTitle = helper::arrayColumn($this->getData(['course']), 'title'); ksort($courseIdShortTitle); foreach ($courseIdShortTitle as $courseId => $courseTitle) { $categorieUrl = helper::baseUrl(!helper::checkRewrite()) . 'course/swap/' . $courseId; @@ -146,7 +146,7 @@ class course extends common $courseId, [ 'title' => $this->getInput('courseAddTitle', helper::FILTER_STRING_SHORT, true), - 'shortTitle' => $this->getInput('courseAddShortTitle', helper::FILTER_STRING_SHORT, true), + 'title' => $this->getInput('courseAddShortTitle', helper::FILTER_STRING_SHORT, true), 'author' => $this->getInput('courseAddAuthor'), 'homePageId' => 'accueil', 'category' => $this->getInput('courseAddCategories'), @@ -201,8 +201,7 @@ class course extends common 'course', $courseId, [ - 'title' => $this->getInput('courseEditTitle', helper::FILTER_STRING_SHORT, true), - 'shortTitle' => $this->getInput('courseEditShortTitle', helper::FILTER_STRING_SHORT, true), + 'title' => $this->getInput('courseEditShortTitle', helper::FILTER_STRING_SHORT, true), 'author' => $this->getInput('courseEditAuthor'), 'homePageId' => $this->getInput('courseEditHomePageId'), 'category' => $this->getInput('courseEditCategories'), @@ -601,7 +600,7 @@ class course extends common $to = helper::dateUTF8('%d %B %Y', $this->getData(['course', $courseId, 'closingDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $courseId, 'closingDate']), self::$i18nUI); $message = sprintf(helper::translate('Ce cours ferme le %s'), $to); } else { - $message = sprintf(helper::translate('Bienvenue dans le cours %s'), $this->getData(['course', $courseId, 'shortTitle'])); + $message = sprintf(helper::translate('Bienvenue dans le cours %s'), $this->getData(['course', $courseId, 'title'])); } $_SESSION['ZWII_SITE_CONTENT'] = $courseId; } @@ -676,7 +675,7 @@ class course extends common foreach ($history['history'] as $pageId => $time) { self::$userHistory[$pageId] = [ helper::dateUTF8('%d %B %Y - %H:%M:%S', $time), - $pages['page'][$pageId]['shortTitle'], + $pages['page'][$pageId]['title'], ]; } @@ -764,7 +763,7 @@ class course extends common } // Valeurs en sortie $this->addOutput([ - 'title' => sprintf(helper::translate('Accéder au cours %s'), $this->getData(['course', $this->getUrl(2), 'shortTitle'])), + 'title' => sprintf(helper::translate('Accéder au cours %s'), $this->getData(['course', $this->getUrl(2), 'title'])), 'view' => 'enrol', 'display' => self::DISPLAY_LAYOUT_LIGHT, ]); diff --git a/core/module/course/view/edit/edit.php b/core/module/course/view/edit/edit.php index dd8b74c..73ad481 100644 --- a/core/module/course/view/edit/edit.php +++ b/core/module/course/view/edit/edit.php @@ -17,19 +17,11 @@

    -
    -
    - 'Titre', - 'value' => $this->getdata(['course', $this->getUrl(2), 'title']) - ]); ?> -
    -
    'Titre court', - 'value' => $this->getdata(['course', $this->getUrl(2), 'shortTitle']) + 'label' => 'Titre', + 'value' => $this->getdata(['course', $this->getUrl(2), 'title']) ]); ?>
    diff --git a/module/courses/view/config/config.css b/module/workshop/view/config/config.css similarity index 100% rename from module/courses/view/config/config.css rename to module/workshop/view/config/config.css diff --git a/module/courses/view/config/config.php b/module/workshop/view/config/config.php similarity index 86% rename from module/courses/view/config/config.php rename to module/workshop/view/config/config.php index 2d56970..c831adb 100644 --- a/module/courses/view/config/config.php +++ b/module/workshop/view/config/config.php @@ -3,7 +3,7 @@
    'buttonGrey', - 'href' => helper::baseUrl() . $this->getUrl(0), + 'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'value' => template::ico('left') ]); ?>
    @@ -19,18 +19,11 @@
    - $this->getData(['module', $this->getUrl(0), 'config', 'title']) ]); ?>
    -
    -
    - $this->getData(['module', $this->getUrl(0), 'config', 'shortTitle']) - ]); ?> -
    -
    - $this->getData(['module', $this->getUrl(0), 'config', 'opening']), + $this->getData(['module', $this->getUrl(0), 'config', 'openingdate']), 'help' => 'Affiché si l\'accès est limité dans le temps', ]); ?>
    - $this->getData(['module', $this->getUrl(0), 'config', 'closing']), + $this->getData(['module', $this->getUrl(0), 'config', 'closingdate']), 'help' => 'Affiché si l\'accès est limité dans le temps', ]); ?>
    diff --git a/module/courses/view/index/index.php b/module/workshop/view/index/index.php similarity index 69% rename from module/courses/view/index/index.php rename to module/workshop/view/index/index.php index 323e545..1cea9f2 100644 --- a/module/courses/view/index/index.php +++ b/module/workshop/view/index/index.php @@ -9,12 +9,8 @@

    - - getData(['module', $this->getUrl(0), 'config', 'title']) === true): ?> - - - - + + getData(['module', $this->getUrl(0), 'config', 'template']) === true): ?> @@ -29,18 +25,26 @@ getData(['module', $this->getUrl(0), 'config', 'author']) === true): ?>

    - signature($courseValue['author']); ?> + signature($courseValue['author'])); ?>

    - getData(['module', $this->getUrl(0), 'config', 'author']) === true): ?> + getData(['module', $this->getUrl(0), 'config', 'access']) === true): ?>

    - - + getData(['module', $this->getUrl(0), 'config', 'openingdate']) === true): ?> +

    + +

    + getData(['module', $this->getUrl(0), 'config', 'closingdate']) === true): ?> +

    + +

    + +

    diff --git a/module/courses/courses.php b/module/workshop/workshop.php similarity index 91% rename from module/courses/courses.php rename to module/workshop/workshop.php index 5a1ee18..69495e0 100644 --- a/module/courses/courses.php +++ b/module/workshop/workshop.php @@ -13,7 +13,7 @@ * @link http://zwiicms.fr/ */ -class courses extends common +class workshop extends common { const VERSION = '1.0'; const REALNAME = 'Liste des cours'; @@ -68,12 +68,11 @@ class courses extends common [ 'category' => $this->getInput('coursesConfigCategories'), 'title' => $this->getInput('coursesConfigShowTitle', helper::FILTER_BOOLEAN), - 'shortTitle' => $this->getInput('coursesConfigShowShortTitle', helper::FILTER_BOOLEAN), 'author' => $this->getInput('coursesConfigShowAuthor', helper::FILTER_BOOLEAN), 'description' => $this->getInput('coursesConfigShowDescription', helper::FILTER_BOOLEAN), 'access' => $this->getInput('coursesConfigShowAccess', helper::FILTER_BOOLEAN), - 'opening' => $this->getInput('coursesConfigShowOpening', helper::FILTER_BOOLEAN), - 'closing' => $this->getInput('coursesConfigShowClosing', helper::FILTER_BOOLEAN), + 'openingdate' => $this->getInput('coursesConfigShowOpeningDate', helper::FILTER_BOOLEAN), + 'closingdate' => $this->getInput('coursesConfigShowClosingDate', helper::FILTER_BOOLEAN), 'enrolment' => $this->getInput('coursesConfigShowEnrolment', helper::FILTER_BOOLEAN), 'urlText' => $this->getInput('coursesConfigUrlText', helper::FILTER_STRING_SHORT), 'layout' => $this->getInput('coursesConfigLayout', helper::FILTER_INT),