public static function getIndexChar($string) { $char = ''; if (!empty($string)) { if (function_exists('mb_substr')) { $char = strtoupper(mb_substr(\GO\Base\Fs\Base::stripInvalidChars($string), 0, 1, 'UTF-8')); } else { $char = strtoupper(substr(\GO\Base\Fs\Base::stripInvalidChars($string), 0, 1)); } } return $char; }
/** * The files module will use this function. */ public function buildFilesPath() { return 'tasks/' . \GO\Base\Fs\Base::stripInvalidChars($this->tasklist->name) . '/' . date('Y', $this->due_time) . '/' . \GO\Base\Fs\Base::stripInvalidChars($this->name) . ' (' . $this->id . ')'; }
/** * The files module will use this function. To create a files folder. * Override it if you don't like the default path. Make sure this path is unique! Appending the (<id>) would be wise. */ public function buildFilesPath() { return isset($this->name) ? $this->getModule() . '/' . \GO\Base\Fs\Base::stripInvalidChars($this->name) : false; }
/** * The files module will use this function. */ public function buildFilesPath() { return 'calendar/' . \GO\Base\Fs\Base::stripInvalidChars($this->calendar->name) . '/' . date('Y', $this->start_time) . '/' . \GO\Base\Fs\Base::stripInvalidChars($this->name) . ' (' . $this->id . ')'; }
/** * The files module will use this function. */ public function buildFilesPath() { $new_folder_name = \GO\Base\Fs\Base::stripInvalidChars($this->name) . ' (' . $this->id . ')'; $new_path = $this->addressbook->buildFilesPath() . '/companies'; $char = \GO\Addressbook\Utils::getIndexChar($new_folder_name); $new_path .= '/' . $char . '/' . $new_folder_name; return $new_path; }
/** * The files module will use this function. */ public function buildFilesPath() { return 'notes/' . Base::stripInvalidChars($this->category->name) . '/' . date('Y', $this->ctime) . '/' . Base::stripInvalidChars($this->name) . ' (' . $this->id . ')'; }
/** * The files module will use this function. */ public function buildFilesPath() { if (!$this->addressbook) { return false; } $new_folder_name = \GO\Base\Fs\Base::stripInvalidChars($this->name) . ' (' . $this->id . ')'; $last_part = empty($this->last_name) ? '' : \GO\Addressbook\Utils::getIndexChar($this->last_name); $new_path = $this->addressbook->buildFilesPath() . '/contacts'; if (!empty($last_part)) { $new_path .= '/' . $last_part; } else { $new_path .= '/0 no last name'; } $new_path .= '/' . $new_folder_name; return $new_path; }