127. ->column('ext', 'png') 128. ->update('company'); 129. Session::delete('company_logo'); 130. } 131. 132. 133. // Picture path 134. public static function picture_file($company) 135. { 136. $file_name = format_id($company->id, 6) . '-' . \Limiter::char($company->name_alias, 32, '') . '_o.' . $company->ext; 137. $picture_file = UPLOADS_DIR . 'company/' . $file_name; 138. return $picture_file; 139. } 140. 141. 142. public static function no_picture($show = true, $attributes = []) 143. { 144. $picture = UPLOADS_DIR . 'no-picture/no-picture.png'; 145. if($show) 146. {
146. { 147. $picture = Html::image($picture, null, null, $attributes); 148. } 149. return $picture; 150. } 151. 152. // Picture path 153. public static function picture_path($company) 154. { 155. $picture_file = self::picture_file($company); 156. $picture_file = (file_exists($picture_file)) ? $picture_file : UPLOADS_DIR . 'no-picture/no-picture.png'; 157. return $picture_file; 158. } 159. 160. // Company Picture 161. public static function picture($company, $attributes = []) 162. { 163. $attributes = ['id' => 'profile-pic', 'alt' => $company->name, 'title' => $company->name]; 164. return Html::image(self::picture_path($company), null, null, $attributes); 165. }
155. $picture_file = self::picture_file($company); 156. $picture_file = (file_exists($picture_file)) ? $picture_file : UPLOADS_DIR . 'no-picture/no-picture.png'; 157. return $picture_file; 158. } 159. 160. // Company Picture 161. public static function picture($company, $attributes = []) 162. { 163. $attributes = ['id' => 'profile-pic', 'alt' => $company->name, 'title' => $company->name]; 164. return Html::image(self::picture_path($company), null, null, $attributes); 165. } 166. 167. // Company Picture Delete 168. public static function picture_delete($company) 169. { 170. 171. 172. $picture_file = self::picture_file($company); 173. 174. if (file_exists($picture_file)) {
50. * 51. * @param string $str 52. * @param int $limit = 500 53. * @param string $endChar = '...' 54. * @param bool $stripTags = true 55. * @param string $encoding = 'utf-8' 56. * 57. * @return string 58. */ 59. public static function char(string $str, int $limit = 500, string $endChar = '...', bool $stripTags = false, string $encoding = "utf-8") : string 60. { 61. $str = trim($str); 62. 63. if( $stripTags === true ) 64. { 65. $str = strip_tags($str); 66. } 67. 68. $str = preg_replace("/\s+/", ' ', str_replace(["\r\n", "\r", "\n", " "], ' ', $str)); 69.