on, '0' -> off, 'default'/absent -> follow the LIVE global default. */ class OrganonProjectHelper extends Base { const EMPHASIZE_KEY = 'organon_tweaks_emphasize_duedate'; const EMPHASIZE_DEFAULT_KEY = 'organon_tweaks_emphasize_duedate_default'; /** * Should the current board emphasize the due date? Board pages only (project_id in the route). * * @return bool */ public function isEmphasizeDueDate() { $project_id = $this->request->getIntegerParam('project_id'); if ($project_id <= 0) { return false; } $value = $this->projectMetadataModel->get($project_id, self::EMPHASIZE_KEY, 'default'); if ($value === '1') { return true; } if ($value === '0') { return false; } // 'default' (or absent) -> follow the live global default. return (int) $this->configModel->get(self::EMPHASIZE_DEFAULT_KEY, 0) === 1; } }