Пример #1
0
 function Run()
 {
     //Load config
     $config = new Config();
     $config->Load();
     $displayManager = new DisplayManager();
     //Create Login Manager
     $loginManager = new LoginManager();
     $loginManager->Load();
     $loginFail = false;
     if ($loginManager->WantLogin()) {
         $loginFail = !$loginManager->TryLogin();
         if (!$loginFail) {
             header('location: index.php');
         }
     }
     if ($loginManager->WantLogout()) {
         $loginManager->Logout();
     }
     if (isset($_GET['want']) and $_GET['want'] == 'logo') {
         $logo = new Logo();
         $logo->Generate();
         return;
     } elseif (isset($_GET['want']) and $_GET['want'] == 'source') {
         $displayManager->DisplaySource();
     } else {
         if ($loginManager->IsLogged()) {
             $imageManager = new ImageManager();
             $images = $imageManager->GetImages();
             $displayManager->DisplayImagesPage($images);
         } else {
             $displayManager->DisplayLoginPage($loginFail);
         }
     }
 }
 public function import()
 {
     if (File::exists(Config::get('filegallery.uploadsfolder') . '/' . Config::get('filegallery.readyfile'))) {
         $files = new ImageManager(Config::get('filegallery.uploadsfolder'), Config::get('filegallery.imagesfolder'));
         if (!$files->import()) {
             $errors = $files->messages()->get('error');
             return Redirect::to('/')->with('error', $errors[0]);
         }
         return Redirect::to('/')->with('success', 'Done importing images.');
     }
     return Redirect::to('/')->with('error', 'Not ready for import.');
 }
Пример #3
0
 /**
  * 生成验证码字符串,写入SESSION,将字符串图片返回给浏览器
  *
  * @param     $len
  * @param int $width
  * @param int $height
  * @param int $font_size
  */
 public static function generate($len, $width = 108, $height = 30, $font_size = 18)
 {
     $sizes = array('18' => array('width' => 25, 'height' => 25));
     $words = self::words($len);
     session_start();
     $session_key = 'captcha';
     $_SESSION[$session_key] = strtolower($words);
     $image = ImageManager::createWhiteImage($width, $height);
     $font_config = array('spacing' => -17, 'font' => '5.ttf');
     $font_path = dirname(__FILE__) . '/font/' . $font_config['font'];
     $color = imagecolorallocate($image, mt_rand(0, 100), mt_rand(20, 120), mt_rand(50, 150));
     $rand = 0;
     $w = $sizes[$font_size]['width'] * $len;
     $h = $sizes[$font_size]['height'];
     $x = round(($width - $w) / 2);
     $y = round(($height + $h) / 2) - 6;
     $coors = imagettftext($image, $font_size, $rand, $x, $y, $color, $font_path, $words);
     if ($coors) {
         header("Cache-Control: no-cache, must-revalidate");
         header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
         header("Pragma: no-cache");
         header("Cache-control: private");
         header('Content-Type: image/png');
         ob_clean();
         imagepng($image);
         imagedestroy($image);
     }
     exit;
 }
Пример #4
0
 public function run()
 {
     $news_repo = app(NewsRepositoryInterface::class);
     // we remove all the files in the config folder
     $files = glob(storage_path('app/news/*'));
     foreach ($files as $file) {
         if (is_file($file)) {
             unlink($file);
         }
     }
     // we create the folder if it doesn't exist
     if (!is_dir($storage_path = storage_path('app/news'))) {
         if (!is_dir($path = storage_path('app'))) {
             mkdir($path);
         }
         mkdir($path . '/news');
     }
     // we insert the news page content
     $file_name = ImageManager::optimizeAndResize(database_path('seeds/files/news/una_news.jpg'), config('image.news.background_image.name'), 'jpg', config('image.news.storage_path'), config('image.news.background_image.sizes'), false);
     $inputs = ['title' => 'Les actualités du club Université Nantes Aviron (UNA)', 'description' => "## Vie du club & actualités sportives\r\n\r\nA partir de cette page, suivez les actualités du club Université Nantes Aviron (UNA).\r\nRésultats sportifs, annonces d'événements, compte-rendus de déplacements ou autres annonces diverses...\r\nNe perdez pas une miette de la vie du club !", 'background_image' => $file_name];
     file_put_contents(storage_path('app/news/content.json'), json_encode($inputs));
     // we create the news
     $news = $news_repo->create(['author_id' => app(UserRepositoryInterface::class)->where('last_name', 'LORENT')->first()->id, 'category_id' => config('news.category_key.club'), 'key' => "rentree-2015-3-sessions-de-portes-ouvertes-a-l-una", 'title' => "Rentrée 2015 : 3 sessions de portes-ouvertes à l'UNA", 'meta_title' => 'Rentrée 2015 : portes-ouvertes', 'meta_description' => null, 'meta_keywords' => 'club, université, nantes, aviron, portes, ouvertes, rentree, 2015, sportive', 'released_at' => Carbon\Carbon::createFromDate(2015, 9, 1)->hour(17)->minute(33), 'content' => "Vous ne savez pas quel sport choisir cette année ?  \r\nVous pensez à l'aviron sans n'avoir jamais osé vous lancer ?  \r\nLe club Université Nantes vous convie à ses portes-ouvertes, l'occasion rêvée de vous essayer gratuitement à notre sport !  \r\n## C'est quand ?  \r\nNous vous accueillons les samedis 12 septembre, 19 septembre et 10 octobre, de 10h à 17h, sans interuption. Nous misons naturellement sur des journées ensoleillées pour vous accueillir de la plus agréable des manières, cependant n'ayez crainte si quelques gouttes de pluie font leur apparition, la pratique demeure possible.  \r\n## Le programme ?  \r\nDes initiations gratuites pour toute la famille (à partir de 10 ans), encadrée par nos professionnels et bénévoles ! Vous vous familiariserez avec la planche à ramer, une embarcation pour débutants qui permet de découvrir le mouvement et les premières sensations de l'aviron. Pas de panique, la planche à ramer est (quasiment) insubmersible !  \r\n## Découvrez le club Université Nantes Aviron (UNA) !  \r\nL'UNA est LE club d'aviron universitaire de Nantes. Nous accueillons à la fois un public d'étudiants à l'Université de Nantes ou dans les écoles supérieures nantaises, mais également des plus jeunes à l'Ecole d'Aviron (entre 10 et 18 ans), ainsi que des moins jeunes (population d'actifs, quelque soit l'age ou le type de pratique).  \r\nPour en savoir plus, rendez-vous sur notre [présentation du club](../#una 'Présentation du club').  \r\n\r\nEt pour toute question, n'hésitez pas, [contactez-nous](#contact 'Contactez-nous') !  \r\nA bientôt au club Université Nantes Aviron", 'active' => false]);
     // we optimize and resize the news image
     $file_name = \ImageManager::optimizeAndResize(database_path('seeds/files/news/news_po_una_september.jpg'), $news->imageName('image'), 'jpg', $news->storagePath(), $news->availableSizes('image'), false);
     $news->image = $file_name;
     $news->save();
     // we create the news
     $news = $news_repo->create(['author_id' => app(UserRepositoryInterface::class)->where('last_name', 'LORENT')->first()->id, 'category_id' => config('news.category_key.club'), 'key' => "lancement-du-nouveau-site-internet-de-l-una", 'title' => "Lancement du nouveau site Internet de l'UNA !", 'meta_title' => null, 'meta_description' => null, 'meta_keywords' => 'club, université, nantes, aviron, nouveau, site, internet, web', 'released_at' => Carbon\Carbon::createFromDate(2016, 5, 6)->hour(10)->minute(00), 'content' => "## Bienvenue sur notre nouveau site Internet !\r\nNous vous souhaitons la bienvenue sur le **nouveau site Internet du club Université Nantes Aviron (UNA)**.\r\nNous sommes heureux de vous présenter notre nouvel outil, vecteur de nos futures communication et qui permettra à tous d'accéder de manière plus facile et efficace à toutes les informations concernant l'UNA.\r\n## Toutes vos informations accessibles en ligne\r\nA travers notre nouveau site, consultez régulièrement nos [actualités sportive ou nouveautés à propos de la vie du club](../../actualites), qui seront automatiquement relayées sur nos réseaux sociaux ([Facebook](https://www.facebook.com/UniversiteNantesAviron), [Twitter](https://twitter.com/unaclub), [Google+](https://plus.google.com/+Univ-nantes-avironFr)). Découvrez également l'[historique du club](../../page/historique), l'[équipe dirigeante](../../equipe-dirigeante) de notre structure, nos [statuts associatifs](../../page/statuts), ainsi que notre [règlement intérieur](../../page/reglement-interieur). Enfin, prenez connaissance de nos [tarifs d'inscription](../../inscription), consultez nos [créneaux horaires](../../horaires) et assurez vous de rester informés de nos événements grâce à notre [calendrier](../../calendrier).\r\n## L'UNA dans votre poche\r\nDe design dit \"Responsive\", ce site **s'adapte à la taille de votre terminal** et vous permet d'accéder à toutes les pages et fonctionnalités proposées depuis vos smartphones, tablettes, ordinateurs portables ou de bureau. Grâce à cela, gardez un oeil sur le club Université Nantes Aviron (UNA), que vous soyiez en déplacement ou à la maison.\r\n## Une plateforme évolutive et collaborative\r\nLoin d'être un outil figé, le site du club Université Nantes Aviron (UNA) se veut **évolutif et à l'écoute de ses utilisateurs**. Il s'agit d'un outil fait par l'UNA et pour l'UNA. C'est ainsi que les actualités, par exemple, seront régulièrement rédigées par une équipe de rédacteurs qui ne sont autres que des rameurs du club. De plus, de nouvelles fonctionnalités telles qu'une page mettant en avant le palmares de l'UNA, un nouveau système de souscription de licence en ligne, une boutique du club en ligne, ... sont autant de fonctionnalités déjà sur le feu !\r\nNous n'en disons pas plus et vous laissons découvrir par vous même notre nouveau site.\r\nVous avez une question, vous souhaitez en savoir plus sur le club ? N'hésitez pas, [contactez-nous](../../#contact) !\r\nA bientôt au club Université Nantes Aviron (UNA).", 'active' => true]);
     // we optimize and resize the news image
     $file_name = \ImageManager::optimizeAndResize(database_path('seeds/files/news/news_una_new_website.jpg'), $news->imageName('image'), 'jpg', $news->storagePath(), $news->availableSizes('image'), false);
     $news->image = $file_name;
     $news->save();
 }
 /**
  * Create all the thumbnails for a picture.
  *
  * @param string        $path Path to the file. This can be a virtual path or a absolute path.
  * @param string        $fileNamePlain Plain file name without extension
  * @param string        $fileExtension Extension of the file
  * @param \ImageManager $imageManager
  *
  * <code>
  * <?php
  * \Cx\Core_Modules\MediaBrowser\Model\FileSystem::createThumbnail(
  *      'files/',
  *      'Django,
  *      'jpg',
  *      new ImageManager() // Please recycle the instance and don't create a new anonymous instance for each call.
  *                         // This is just a simple example.
  * );
  * ?>
  * </code>
  *
  * @return array With all thumbnail types and if they were generated successfully.
  */
 public static function createThumbnail($path, $fileNamePlain, $fileExtension, \ImageManager $imageManager, $generateThumbnailByRatio = false)
 {
     $success = array();
     foreach (UploaderConfiguration::getInstance()->getThumbnails() as $thumbnail) {
         if (\Cx\Lib\FileSystem\FileSystem::exists(MediaSourceManager::getAbsolutePath($path) . $fileNamePlain . $thumbnail['value'] . '.' . $fileExtension)) {
             $success[$thumbnail['value']] = self::THUMBNAIL_GENERATOR_NEUTRAL;
             continue;
         }
         if ($imageManager->_createThumb(MediaSourceManager::getAbsolutePath($path) . '/', '', $fileNamePlain . '.' . $fileExtension, $thumbnail['size'], $thumbnail['quality'], $fileNamePlain . $thumbnail['value'] . '.' . $fileExtension, $generateThumbnailByRatio)) {
             $success[$thumbnail['value']] = self::THUMBNAIL_GENERATOR_SUCCESS;
             continue;
         }
         $success[$thumbnail['value']] = self::THUMBNAIL_GENERATOR_FAIL;
     }
     return $success;
 }
Пример #6
0
 /**
  *
  */
 public function renderContent($setting)
 {
     $t = array('name' => '', 'image' => '', 'imagesize' => '', 'alignment' => '', 'animation' => '', 'ispopup' => '1', 'imageurl' => '');
     $protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? 'https://' : 'http://';
     $url = Tools::htmlentitiesutf8($protocol . $_SERVER['HTTP_HOST'] . __PS_BASE_URI__);
     $setting = array_merge($t, $setting);
     $size = explode('x', $setting['size']);
     $setting['thumbnailurl'] = _PAGEBUILDER_IMAGE_URL_ . $setting['imagefile'];
     $setting['imageurl'] = _PAGEBUILDER_IMAGE_URL_ . $setting['imagefile'];
     if (count($size) == 2) {
         $cache = _PS_CACHE_DIR_ . 'pspagebuilder/';
         if (!file_exists($cache . $setting['imagefile'])) {
             if (!is_dir($cache)) {
                 mkdir($cache, 0755);
             }
             if (ImageManager::resize(_PAGEBUILDER_IMAGE_DIR_ . $setting['imagefile'], $cache . $setting['imagefile'], $size[0], $size[1])) {
                 $setting['thumbnailurl'] = $url . 'cache/pspagebuilder/' . $setting['imagefile'];
             }
         } else {
             $setting['thumbnailurl'] = $url . 'cache/pspagebuilder/' . $setting['imagefile'];
         }
     }
     $output = array('type' => 'image', 'data' => $setting);
     return $output;
 }
Пример #7
0
 /**
  *
  */
 public function renderContent($setting)
 {
     $t = array('name' => '', 'image' => '', 'imagesize' => '80x80', 'alignment' => '', 'animation' => '', 'ispopup' => '1', 'imageurl' => '', 'icon' => '', 'widget_heading' => '', 'icon_position' => 'left');
     $protocol = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443 ? 'https://' : 'http://';
     $url = Tools::htmlentitiesutf8($protocol . $_SERVER['HTTP_HOST'] . __PS_BASE_URI__);
     $setting = array_merge($t, $setting);
     $size = explode('x', $setting['imagesize']);
     //$setting['thumbnailurl'] = $url.'modules/pspagebuilder/images/'.$setting['imagefile'];
     //$setting['imageurl'] = $url.'modules/pspagebuilder/images/'.$setting['imagefile'];
     $setting['thumbnailurl'] = '';
     $setting['imageurl'] = '';
     if (count($size) == 2 && empty($setting['icon'])) {
         $cache = _PS_CACHE_DIR_ . 'pspagebuilder/';
         if (!file_exists($cache . $setting['imagefile'])) {
             if (!is_dir($cache)) {
                 mkdir($cache, 0777);
             }
             if (ImageManager::resize(_PAGEBUILDER_IMAGE_DIR_ . $setting['imagefile'], $cache . $setting['imagefile'], $size[0], $size[1])) {
                 $setting['thumbnailurl'] = $url . 'cache/pspagebuilder/' . $setting['imagefile'];
             }
         } else {
             $setting['thumbnailurl'] = $url . 'cache/pspagebuilder/' . $setting['imagefile'];
         }
     }
     $setting['content'] = $this->getValueByLang($setting, 'content');
     $output = array('type' => 'ourservice', 'data' => $setting);
     return $output;
 }
Пример #8
0
 protected function afterImageUpload()
 {
     /* Generate image with differents size */
     if (!($obj = $this->loadObject(true))) {
         return;
     }
     if ($obj->id && (isset($_FILES['image']) || isset($_FILES['thumb']))) {
         $base_img_path = _PS_SCENE_IMG_DIR_ . $obj->id . '.jpg';
         $images_types = ImageType::getImagesTypes('scenes');
         foreach ($images_types as $k => $image_type) {
             if ($image_type['name'] == 'scene_default' && isset($_FILES['image'])) {
                 ImageManager::resize($base_img_path, _PS_SCENE_IMG_DIR_ . $obj->id . '-' . stripslashes($image_type['name']) . '.jpg', (int) $image_type['width'], (int) $image_type['height']);
             } else {
                 if ($image_type['name'] == 'm_scene_default') {
                     if (isset($_FILES['thumb']) && !$_FILES['thumb']['error']) {
                         $base_thumb_path = _PS_SCENE_THUMB_IMG_DIR_ . $obj->id . '.jpg';
                     } else {
                         $base_thumb_path = $base_img_path;
                     }
                     ImageManager::resize($base_thumb_path, _PS_SCENE_THUMB_IMG_DIR_ . $obj->id . '-' . stripslashes($image_type['name']) . '.jpg', (int) $image_type['width'], (int) $image_type['height']);
                 }
             }
         }
     }
     return true;
 }
 protected function validate(&$file)
 {
     $file['error'] = $this->checkUploadError($file['error']);
     if ($file['error']) {
         return false;
     }
     $post_max_size = Tools::convertBytes(ini_get('post_max_size'));
     $upload_max_filesize = Tools::convertBytes(ini_get('upload_max_filesize'));
     if ($post_max_size && $this->_getServerVars('CONTENT_LENGTH') > $post_max_size) {
         $file['error'] = Tools::displayError('The uploaded file exceeds the post_max_size directive in php.ini');
         return false;
     }
     if ($upload_max_filesize && $this->_getServerVars('CONTENT_LENGTH') > $upload_max_filesize) {
         $file['error'] = Tools::displayError('The uploaded file exceeds the upload_max_filesize directive in php.ini');
         return false;
     }
     if ($error = ImageManager::validateUpload($file, Tools::getMaxUploadSize($this->getMaxSize()), $this->getAcceptTypes())) {
         $file['error'] = $error;
         return false;
     }
     if ($file['size'] > $this->getMaxSize()) {
         $file['error'] = sprintf(Tools::displayError('File (size : %1s) is too big (max : %2s)'), $file['size'], $this->getMaxSize());
         return false;
     }
     return true;
 }
Пример #10
0
 /**
  * Returns the template's HTML content
  * @return string HTML content
  */
 public function getContent()
 {
     $invoice_address = new Address((int) $this->order->id_address_invoice);
     $country = new Country((int) $invoice_address->id_country);
     $formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
     $formatted_delivery_address = '';
     if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
         $delivery_address = new Address((int) $this->order->id_address_delivery);
         $formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
     }
     $customer = new Customer((int) $this->order->id_customer);
     $order_details = $this->order_invoice->getProducts();
     if (Configuration::get('PS_PDF_IMG_INVOICE')) {
         foreach ($order_details as &$order_detail) {
             if ($order_detail['image'] != null) {
                 $name = 'product_mini_' . (int) $order_detail['product_id'] . (isset($order_detail['product_attribute_id']) ? '_' . (int) $order_detail['product_attribute_id'] : '') . '.jpg';
                 $order_detail['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_ . 'p/' . $order_detail['image']->getExistingImgPath() . '.jpg', $name, 45, 'jpg', false);
                 if (file_exists(_PS_TMP_IMG_DIR_ . $name)) {
                     $order_detail['image_size'] = getimagesize(_PS_TMP_IMG_DIR_ . $name);
                 } else {
                     $order_detail['image_size'] = false;
                 }
             }
         }
     }
     $data = array('order' => $this->order, 'order_details' => $order_details, 'cart_rules' => $this->order->getCartRules($this->order_invoice->id), 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'tax_excluded_display' => Group::getPriceDisplayMethod($customer->id_default_group), 'tax_tab' => $this->getTaxTabContent(), 'customer' => $customer);
     if (Tools::getValue('debug')) {
         die(json_encode($data));
     }
     $this->smarty->assign($data);
     return $this->smarty->fetch($this->getTemplateByCountry($country->iso_code));
 }
Пример #11
0
 /**
  * Returns the template's HTML content
  *
  * @return string HTML content
  */
 public function getContent()
 {
     $delivery_address = new Address((int) $this->order->id_address_delivery);
     $formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
     $formatted_invoice_address = '';
     if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
         $invoice_address = new Address((int) $this->order->id_address_invoice);
         $formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
     }
     $carrier = new Carrier($this->order->id_carrier);
     $carrier->name = $carrier->name == '0' ? Configuration::get('PS_SHOP_NAME') : $carrier->name;
     $order_details = $this->order_invoice->getProducts();
     if (Configuration::get('PS_PDF_IMG_DELIVERY')) {
         foreach ($order_details as &$order_detail) {
             if ($order_detail['image'] != null) {
                 $name = 'product_mini_' . (int) $order_detail['product_id'] . (isset($order_detail['product_attribute_id']) ? '_' . (int) $order_detail['product_attribute_id'] : '') . '.jpg';
                 $path = _PS_PROD_IMG_DIR_ . $order_detail['image']->getExistingImgPath() . '.jpg';
                 $order_detail['image_tag'] = preg_replace('/\\.*' . preg_quote(__PS_BASE_URI__, '/') . '/', _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR, ImageManager::thumbnail($path, $name, 45, 'jpg', false), 1);
                 if (file_exists(_PS_TMP_IMG_DIR_ . $name)) {
                     $order_detail['image_size'] = getimagesize(_PS_TMP_IMG_DIR_ . $name);
                 } else {
                     $order_detail['image_size'] = false;
                 }
             }
         }
     }
     $this->smarty->assign(array('order' => $this->order, 'order_details' => $order_details, 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'order_invoice' => $this->order_invoice, 'carrier' => $carrier, 'display_product_images' => Configuration::get('PS_PDF_IMG_DELIVERY')));
     $tpls = array('style_tab' => $this->smarty->fetch($this->getTemplate('delivery-slip.style-tab')), 'addresses_tab' => $this->smarty->fetch($this->getTemplate('delivery-slip.addresses-tab')), 'summary_tab' => $this->smarty->fetch($this->getTemplate('delivery-slip.summary-tab')), 'product_tab' => $this->smarty->fetch($this->getTemplate('delivery-slip.product-tab')), 'payment_tab' => $this->smarty->fetch($this->getTemplate('delivery-slip.payment-tab')));
     $this->smarty->assign($tpls);
     return $this->smarty->fetch($this->getTemplate('delivery-slip'));
 }
 public function postProcess()
 {
     if (Tools::isSubmit('submitStoreConf')) {
         Configuration::updateValue('PRODUCTPAYMENTLOGOS_LINK', Tools::getValue('PRODUCTPAYMENTLOGOS_LINK'));
         Configuration::updateValue('PRODUCTPAYMENTLOGOS_TITLE', Tools::getValue('PRODUCTPAYMENTLOGOS_TITLE'));
         if (isset($_FILES['PRODUCTPAYMENTLOGOS_IMG']) && isset($_FILES['PRODUCTPAYMENTLOGOS_IMG']['tmp_name']) && !empty($_FILES['PRODUCTPAYMENTLOGOS_IMG']['tmp_name'])) {
             if (ImageManager::validateUpload($_FILES['PRODUCTPAYMENTLOGOS_IMG'], 4000000)) {
                 return $this->displayError($this->l('Invalid image'));
             } else {
                 $ext = Tools::substr($_FILES['PRODUCTPAYMENTLOGOS_IMG']['name'], Tools::strrpos($_FILES['PRODUCTPAYMENTLOGOS_IMG']['name'], '.') + 1);
                 $file_name = md5($_FILES['PRODUCTPAYMENTLOGOS_IMG']['name']) . '.' . $ext;
                 if (!move_uploaded_file($_FILES['PRODUCTPAYMENTLOGOS_IMG']['tmp_name'], dirname(__FILE__) . '/img/' . $file_name)) {
                     return $this->displayError($this->l('An error occurred while attempting to upload the file.'));
                 } else {
                     $file_path = dirname(__FILE__) . '/img/' . Configuration::get('PRODUCTPAYMENTLOGOS_IMG');
                     if (Configuration::hasContext('PRODUCTPAYMENTLOGOS_IMG', null, Shop::getContext()) && Configuration::get('PRODUCTPAYMENTLOGOS_IMG') != $file_name && file_exists($file_path)) {
                         unlink($file_path);
                     }
                     Configuration::updateValue('PRODUCTPAYMENTLOGOS_IMG', $file_name);
                     $this->_clearCache('productpaymentlogos.tpl');
                     Tools::redirectAdmin('index.php?tab=AdminModules&conf=6&configure=' . $this->name . '&token=' . Tools::getAdminTokenLite('AdminModules'));
                 }
             }
         }
         $this->_clearCache('productpaymentlogos.tpl');
     }
     return '';
 }
 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         ImageManager::create([]);
     }
 }
Пример #14
0
 /**
  * Returns the template's HTML content
  * @return string HTML content
  */
 public function getContent()
 {
     $delivery_address = new Address((int) $this->order->id_address_delivery);
     $formatted_delivery_address = AddressFormat::generateAddress($delivery_address, array(), '<br />', ' ');
     $formatted_invoice_address = '';
     if ($this->order->id_address_delivery != $this->order->id_address_invoice) {
         $invoice_address = new Address((int) $this->order->id_address_invoice);
         $formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '<br />', ' ');
     }
     $carrier = new Carrier($this->order->id_carrier);
     $carrier->name = $carrier->name == '0' ? Configuration::get('PS_SHOP_NAME') : $carrier->name;
     $order_details = $this->order_invoice->getProducts();
     if (Configuration::get('PS_PDF_IMG_DELIVERY')) {
         foreach ($order_details as &$order_detail) {
             if ($order_detail['image'] != null) {
                 $name = 'product_mini_' . (int) $order_detail['product_id'] . (isset($order_detail['product_attribute_id']) ? '_' . (int) $order_detail['product_attribute_id'] : '') . '.jpg';
                 $order_detail['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_ . 'p/' . $order_detail['image']->getExistingImgPath() . '.jpg', $name, 45, 'jpg', false);
                 if (file_exists(_PS_TMP_IMG_DIR_ . $name)) {
                     $order_detail['image_size'] = getimagesize(_PS_TMP_IMG_DIR_ . $name);
                 } else {
                     $order_detail['image_size'] = false;
                 }
             }
         }
     }
     $this->smarty->assign(array('order' => $this->order, 'order_details' => $order_details, 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'order_invoice' => $this->order_invoice, 'carrier' => $carrier));
     return $this->smarty->fetch($this->getTemplate('delivery-slip'));
 }
Пример #15
0
 public function postProcess()
 {
     if (Tools::isSubmit('submitStoreConf')) {
         if (!($languages = Language::getLanguages(true))) {
             return false;
         }
         $text = array();
         foreach ($languages as $lang) {
             $text[$lang['id_lang']] = Tools::getValue('BLOCKSTORE_TEXT_' . $lang['id_lang']);
         }
         Configuration::updateValue('BLOCKSTORE_TEXT', $text);
         if (isset($_FILES['BLOCKSTORE_IMG']) && isset($_FILES['BLOCKSTORE_IMG']['tmp_name']) && !empty($_FILES['BLOCKSTORE_IMG']['tmp_name'])) {
             if ($error = ImageManager::validateUpload($_FILES['BLOCKSTORE_IMG'], 4000000)) {
                 return $this->displayError($this->l('Invalid image.'));
             } else {
                 $ext = substr($_FILES['BLOCKSTORE_IMG']['name'], strrpos($_FILES['BLOCKSTORE_IMG']['name'], '.') + 1);
                 $file_name = md5($_FILES['BLOCKSTORE_IMG']['name']) . '.' . $ext;
                 if (!move_uploaded_file($_FILES['BLOCKSTORE_IMG']['tmp_name'], dirname(__FILE__) . '/' . $file_name)) {
                     return $this->displayError($this->l('An error occurred while attempting to upload the file.'));
                 } else {
                     if (Configuration::hasContext('BLOCKSTORE_IMG', null, Shop::getContext()) && Configuration::get('BLOCKSTORE_IMG') != $file_name) {
                         @unlink(dirname(__FILE__) . '/' . Configuration::get('BLOCKSTORE_IMG'));
                     }
                     Configuration::updateValue('BLOCKSTORE_IMG', $file_name);
                     $this->_clearCache('blockstore.tpl');
                     return $this->displayConfirmation($this->l('The settings have been updated.'));
                 }
             }
         }
         $this->_clearCache('blockstore.tpl');
     }
     return '';
 }
Пример #16
0
 protected function postProcess()
 {
     $errors = '';
     if (Tools::isSubmit('deleteImage')) {
         if (!file_exists(dirname(__FILE__) . '/img/' . $this->_getUserImg())) {
             $errors .= $this->displayError($this->l('This action cannot be taken.'));
         } else {
             unlink(dirname(__FILE__) . '/img/' . $this->_getUserImg());
             Tools::redirectAdmin('index.php?tab=AdminModules&conf=4&configure=' . $this->name . '&token=' . Tools::getAdminToken('AdminModules' . (int) Tab::getIdFromClassName('AdminModules') . (int) $this->context->employee->id));
         }
     }
     if (Tools::isSubmit('submitUpdateScrolltop')) {
         if (isset($_FILES['image']) && $_FILES['image']['error'] == 0) {
             if ($error = ImageManager::validateUpload($_FILES['image'])) {
                 $errors .= $this->displayError($error);
             } elseif (!ImageManager::resize($_FILES['image']['tmp_name'], dirname(__FILE__) . '/img/' . $this->_getUserImg())) {
                 $errors .= $this->displayError($this->l('An error occurred during the image upload.'));
             }
         }
         foreach ($this->_scrollParams as $param => $value) {
             if ($val = (int) Tools::getValue($param)) {
                 $this->_setScrollParam($param, $val);
             } else {
                 $errors .= $this->displayError($this->l('"' . $param . '" is not valid.'));
             }
         }
         if (!$errors) {
             Tools::redirectAdmin('index.php?tab=AdminModules&conf=4&configure=' . $this->name . '&token=' . Tools::getAdminToken('AdminModules' . (int) Tab::getIdFromClassName('AdminModules') . (int) $this->context->employee->id));
         }
     }
     $this->_html .= $errors;
 }
Пример #17
0
 public function uploadMainImage($image, $hotel_id, $hotel_img_path, $active = false)
 {
     if (isset($image)) {
         if ($image['size'] > 0) {
             $rand_name = $this->randomImageName();
             Db::getInstance()->insert('htl_image', array('id_hotel' => (int) $hotel_id, 'hotel_image_id' => pSQL($rand_name)));
             $image_name = $rand_name . '.jpg';
             ImageManager::resize($image['tmp_name'], $hotel_img_path . $image_name);
         }
     }
 }
 public function validateHotelHeaderImage($image)
 {
     if ($image['size'] > 0) {
         if ($image['tmp_name'] != "") {
             if (!ImageManager::isCorrectImageFileExt($image['name'])) {
                 $this->errors[] = Tools::displayError('<strong>' . $_FILES['header_image']['name'] . '</strong> : Image format not recognized, allowed formats are: .gif, .jpg, .png', false);
             }
         }
     } else {
         return true;
     }
 }
 public function ajaxProcessuploadThumbnailImages()
 {
     $category = new Category((int) Tools::getValue('id_category'));
     if (isset($_FILES['thumbnail'])) {
         //Get total of image already present in directory
         $files = scandir(_PS_CAT_IMG_DIR_);
         $assigned_keys = array();
         $allowed_keys = array(0, 1, 2);
         foreach ($files as $file) {
             $matches = array();
             if (preg_match('/' . $category->id . '-([0-9])?_thumb.jpg/i', $file, $matches) === 1) {
                 $assigned_keys[] = (int) $matches[1];
             }
         }
         $available_keys = array_diff($allowed_keys, $assigned_keys);
         $helper = new HelperImageUploader('thumbnail');
         $files = $helper->process();
         $total_errors = array();
         if (count($available_keys) < count($files)) {
             $total_errors[] = sprintf(Tools::displayError('You cannot upload more than %s files'), count($available_keys));
             die;
         }
         foreach ($files as $key => &$file) {
             $id = array_shift($available_keys);
             $errors = array();
             // Evaluate the memory required to resize the image: if it's too much, you can't resize it.
             if (!ImageManager::checkImageMemoryLimit($file['save_path'])) {
                 $errors[] = Tools::displayError('Due to memory limit restrictions, this image cannot be loaded. Please increase your memory_limit value via your server\'s configuration settings. ');
             }
             // Copy new image
             if (empty($errors) && !ImageManager::resize($file['save_path'], _PS_CAT_IMG_DIR_ . (int) Tools::getValue('id_category') . '-' . $id . '_thumb.jpg')) {
                 $errors[] = Tools::displayError('An error occurred while uploading the image.');
             }
             if (count($errors)) {
                 $total_errors = array_merge($total_errors, $errors);
             }
             unlink($file['save_path']);
             //Necesary to prevent hacking
             unset($file['save_path']);
             //Add image preview and delete url
             $file['image'] = ImageManager::thumbnail(_PS_CAT_IMG_DIR_ . (int) $category->id . '-' . $id . '_thumb.jpg', $this->context->controller->table . '_' . (int) $category->id . '-' . $id . '_thumb.jpg', 100, 'jpg', true, true);
             $file['delete_url'] = Context::getContext()->link->getAdminLink('AdminBlockCategories') . '&deleteThumb=' . $id . '&id_category=' . (int) $category->id . '&updatecategory';
         }
         if (count($total_errors)) {
             $this->context->controller->errors = array_merge($this->context->controller->errors, $total_errors);
         } else {
             Tools::clearSmartyCache();
         }
         die(Tools::jsonEncode(array('thumbnail' => $files)));
     }
 }
Пример #20
0
 public function menu()
 {
     // TODO:
     $cafeName = $this->f3->get('PARAMS.cafeName');
     if (strtolower($cafeName) == 'richmond') {
         $this->f3->set('isRichmond', 'active');
         $cafeId = 1;
     } else {
         if (strtolower($cafeName) == 'malvern') {
             $this->f3->set('isMalvern', 'active');
             $cafeId = 2;
         }
     }
     $this->f3->set('cafeId', $cafeId);
     // create blur effect for background
     $this->f3->set('isBlurred', 'blur');
     // retrieve all pictures and return links to client
     $images = new ImageManager($this->db);
     $menuImages = $images->allForMenu();
     // retrieve all categories and setup for template
     $cats = new Category($this->db);
     $categories = $cats->all();
     $this->f3->set('categories', $categories);
     $firstCategory = $categories[0]->categoryId;
     $info = new Info($this->db);
     $this->f3->set('isPriceOn', $info->all()[0]->isPriceOn);
     // setup for client
     $clientArray = array();
     foreach ($menuImages as $menuImage) {
         $clientArray[] = $menuImage->imageLink;
     }
     // retreive all items based on $cafeId
     $items = new Item($this->db);
     $this->f3->set('items', $items->getAllByCategoryId($cafeId, $firstCategory));
     $this->f3->set('pictureArray', $clientArray);
     $this->f3->set('ESCAPE', false);
     $this->f3->set('view', 'user/menu.html');
 }
Пример #21
0
 /**
  * Old legacy way to generate a thumbnail.
  *
  * Use it upon a new Image management system is available.
  *
  * @param $imageId
  * @param string $imageType
  * @param string $tableName
  * @param string $imageDir
  * @return string The HTML < img > tag
  */
 public function getThumbnailForListing($imageId, $imageType = 'jpg', $tableName = 'product', $imageDir = 'p')
 {
     if ($tableName == 'product') {
         $image = new \Image($imageId);
         $path_to_image = _PS_IMG_DIR_ . $imageDir . '/' . $image->getExistingImgPath() . '.' . $imageType;
     } else {
         $path_to_image = _PS_IMG_DIR_ . $imageDir . '/' . $imageId . '.' . $imageType;
     }
     $thumbPath = \ImageManager::thumbnail($path_to_image, $tableName . '_mini_' . $imageId . '.' . $imageType, 45, $imageType);
     // because legacy uses relative path to reach a directory under root directory...
     $replacement = 'src="' . $this->legacyContext->getRootUrl();
     $thumbPath = preg_replace('/src="(\\.\\.\\/)+/', $replacement, $thumbPath);
     return $thumbPath;
 }
Пример #22
0
 public function action_index()
 {
     if ($this->session->ouverte()) {
         $this->set_title("Module Nos voitures");
         if ($this->req->name) {
             $db = DB::get_instance();
             $modm = new ModeleManager($db);
             $imgm = new ImageManager($db);
             $mod = $modm->getByName($this->req->name);
             $cm = new CommentaireManager($db);
             if ($mod) {
                 $idmodele = $mod->getIdModele();
                 $listeCom = $cm->listing($idmodele);
                 $this->tpl->assign("com", $listeCom);
                 $listeImg = $imgm->listing($idmodele);
                 $this->tpl->assign("photo", $listeImg);
             } else {
                 Site::redirect('loc', 'index');
             }
         } else {
             Site::redirect('index');
         }
         $fcom = new Form("?module=car&action=validcom&name=" . $this->req->name, "f_com");
         $i = 0;
         $notes[] = '';
         while ($i < 6) {
             $notes[] = $i;
             $i++;
         }
         $fcom->add_select("note", "note", "Note", $notes);
         $fcom->add_textarea("com", "com", "");
         $fcom->add_submit("", "", "")->set_value("Envoyez");
         $this->tpl->assign("f_com", $fcom);
     } else {
         Site::redirect("login");
     }
 }
Пример #23
0
     //		);
     return parent::renderForm();
 }
 protected function afterImageUpload()
 {
     $res = true;
     /* Generate image with differents size */
     if (($id_friend_data = (int) Tools::getValue('id_friend_data')) && isset($_FILES) && isset($_FILES) && count($_FILES) && $_FILES['image']['name'] != null && file_exists(_PS_MYFRIENDS_IMG_DIR_ . $id_friend_data . '.jpg')) {
         $images_types = ImageType::getImagesTypes('products');
         foreach ($images_types as $k => $image_type) {
             $res &= ImageManager::resize(_PS_MYFRIENDS_IMG_DIR_ . $id_friend_data . '.jpg', _PS_MYFRIENDS_IMG_DIR_ . $id_friend_data . '-' . stripslashes($image_type['name']) . '.jpg', (int) $image_type['width'], (int) $image_type['height']);
         }
     }
     if (!$res) {
         $this->errors[] = Tools::displayError('Unable to resize one or more of your pictures.');
Пример #24
0
 protected function validate(&$file)
 {
     $post_max_size = $this->getPostMaxSizeBytes();
     if ($post_max_size && $this->_getServerVars('CONTENT_LENGTH') > $post_max_size) {
         $file['error'] = Tools::displayError('The uploaded file exceeds the post_max_size directive in php.ini');
         return false;
     }
     if ($error = ImageManager::validateUpload($file, Tools::getMaxUploadSize($this->getMaxSize()), $this->getAcceptTypes())) {
         $file['error'] = $error;
         return false;
     }
     if ($file['size'] > $this->getMaxSize()) {
         $file['error'] = Tools::displayError('File is too big');
         return false;
     }
     return true;
 }
Пример #25
0
 protected function renderImage($url, $image, $size)
 {
     $setting = array();
     $setting['thumbnailurl'] = _PAGEBUILDER_IMAGE_URL_ . $image;
     $setting['imageurl'] = _PAGEBUILDER_IMAGE_URL_ . $image;
     if (count($size) == 2) {
         $cache = _PS_CACHE_DIR_ . 'pspagebuilder/';
         if (!file_exists($cache . $image)) {
             if (!is_dir($cache)) {
                 mkdir($cache, 0755);
             }
             if (ImageManager::resize(_PAGEBUILDER_IMAGE_DIR_ . $image, $cache . $image, $size[0], $size[1])) {
                 $setting['thumbnailurl'] = $url . 'cache/pspagebuilder/' . $image;
             }
         } else {
             $setting['thumbnailurl'] = $url . 'cache/pspagebuilder/' . $image;
         }
     }
     return $setting;
 }
Пример #26
0
 public function postProcess()
 {
     if (Tools::isSubmit('submitStoreConf')) {
         if (isset($_FILES['store_img']) && isset($_FILES['store_img']['tmp_name']) && !empty($_FILES['store_img']['tmp_name'])) {
             if ($error = ImageManager::validateUpload($_FILES['store_img'], 4000000)) {
                 return $this->displayError($this->l('invalid image'));
             } else {
                 if (!move_uploaded_file($_FILES['store_img']['tmp_name'], dirname(__FILE__) . '/' . $_FILES['store_img']['name'])) {
                     return $this->displayError($this->l('an error occurred on uploading file'));
                 } else {
                     if (Configuration::hasContext('BLOCKSTORE_IMG', null, Shop::getContext()) && Configuration::get('BLOCKSTORE_IMG') != $_FILES['store_img']['name']) {
                         @unlink(dirname(__FILE__) . '/' . Configuration::get('BLOCKSTORE_IMG'));
                     }
                     Configuration::updateValue('BLOCKSTORE_IMG', $_FILES['store_img']['name']);
                     return $this->displayConfirmation($this->l('Settings are updated'));
                 }
             }
         }
     }
     return '';
 }
Пример #27
0
 protected function uploadImage($id, $name, $dir, $ext = false, $width = null, $height = null)
 {
     if (isset($_FILES[$name]['tmp_name']) && !empty($_FILES[$name]['tmp_name'])) {
         // Delete old image
         if (Validate::isLoadedObject($object = $this->loadObject())) {
             $object->deleteImage();
         } else {
             return false;
         }
         // Check image validity
         $max_size = isset($this->max_image_size) ? $this->max_image_size : 0;
         if ($error = ImageManager::validateUpload($_FILES[$name], Tools::getMaxUploadSize($max_size))) {
             $this->errors[] = $error;
         }
         $tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS');
         if (!$tmp_name) {
             return false;
         }
         if (!move_uploaded_file($_FILES[$name]['tmp_name'], $tmp_name)) {
             return false;
         }
         // Evaluate the memory required to resize the image: if it's too much, you can't resize it.
         if (!ImageManager::checkImageMemoryLimit($tmp_name)) {
             $this->errors[] = Tools::displayError('Due to memory limit restrictions, this image cannot be loaded. Please increase your memory_limit value via your server\'s configuration settings. ');
         }
         // Copy new image
         if (empty($this->errors) && !ImageManager::resize($tmp_name, _PS_MODULE_DIR_ . 'possequence' . DS . 'images' . DS . $name . '_' . $id . '.' . $this->imageType, (int) $width, (int) $height, $ext ? $ext : $this->imageType)) {
             $this->errors[] = Tools::displayError('An error occurred while uploading the image.');
         }
         if (count($this->errors)) {
             return false;
         }
         if ($this->afterImageUpload()) {
             unlink($tmp_name);
             return true;
         }
         return false;
     }
     return true;
 }
Пример #28
0
 public function postProcess()
 {
     if (Tools::isSubmit('submitStoreConf')) {
         if (isset($_FILES['store_img']) && isset($_FILES['store_img']['tmp_name']) && !empty($_FILES['store_img']['tmp_name'])) {
             if ($error = ImageManager::validateUpload($_FILES['store_img'], 4000000)) {
                 return $this->displayError($this->l('Invalid image'));
             } else {
                 if (!move_uploaded_file($_FILES['store_img']['tmp_name'], dirname(__FILE__) . '/' . $_FILES['store_img']['name'])) {
                     return $this->displayError($this->l('An error occurred while attempting to upload the file.'));
                 } else {
                     if (Configuration::hasContext('BLOCKSTORE_IMG', null, Shop::getContext()) && Configuration::get('BLOCKSTORE_IMG') != $_FILES['store_img']['name']) {
                         @unlink(dirname(__FILE__) . '/' . Configuration::get('BLOCKSTORE_IMG'));
                     }
                     Configuration::updateValue('BLOCKSTORE_IMG', $_FILES['store_img']['name']);
                     $this->_clearCache('blockstore.tpl');
                     return $this->displayConfirmation($this->l('The settings have been updated.'));
                 }
             }
         }
     }
     return '';
 }
Пример #29
0
 public function run()
 {
     $partner_repo = app()->make(App\Repositories\Partner\PartnerRepositoryInterface::class);
     // we remove all the files in the config folder
     $files = glob(storage_path('app/partners/*'));
     foreach ($files as $file) {
         if (is_file($file)) {
             unlink($file);
         }
     }
     // we create the folder if it doesn't exist
     if (!is_dir($storage_path = storage_path('app/partners'))) {
         if (!is_dir($path = storage_path('app'))) {
             mkdir($path);
         }
         mkdir($path . '/partners');
     }
     // ville de nantes
     $slide = $partner_repo->create(['name' => 'Ville de Nantes', 'logo' => null, 'url' => 'http://www.nantes.fr', 'position' => 1, 'active' => true]);
     $file_name = \ImageManager::optimizeAndResize(database_path('seeds/files/partners/logo-ville-nantes.png'), $slide->imageName('logo'), 'png', $slide->storagePath(), $slide->availableSizes('logo'), false);
     $slide->logo = $file_name;
     $slide->save();
     // université de nantes
     $slide = $partner_repo->create(['name' => 'Université de Nantes', 'logo' => null, 'url' => 'http://www.univ-nantes.fr', 'position' => 2, 'active' => true]);
     $file_name = \ImageManager::optimizeAndResize(database_path('seeds/files/partners/logo-univ-nantes.png'), $slide->imageName('logo'), 'png', $slide->storagePath(), $slide->availableSizes('logo'), false);
     $slide->logo = $file_name;
     $slide->save();
     // ffa
     $slide = $partner_repo->create(['name' => 'Fédération Française d\'Aviron (FFA)', 'logo' => null, 'url' => 'http://avironfrance.fr', 'position' => 3, 'active' => true]);
     $file_name = \ImageManager::optimizeAndResize(database_path('seeds/files/partners/logo-ffa.png'), $slide->imageName('logo'), 'png', $slide->storagePath(), $slide->availableSizes('logo'), false);
     $slide->logo = $file_name;
     $slide->save();
     // ffsu
     $slide = $partner_repo->create(['name' => 'Fédération Française des Sports Universitaires', 'logo' => null, 'url' => 'http://www.sport-u.com', 'position' => 4, 'active' => true]);
     $file_name = \ImageManager::optimizeAndResize(database_path('seeds/files/partners/logo-ffsu.png'), $slide->imageName('logo'), 'png', $slide->storagePath(), $slide->availableSizes('logo'), false);
     $slide->logo = $file_name;
     $slide->save();
 }
Пример #30
0
 public function run()
 {
     $chedule_repo = app(ScheduleRepositoryInterface::class);
     // we remove all the files in the config folder
     $files = glob(storage_path('app/schedules/*'));
     foreach ($files as $file) {
         if (is_file($file)) {
             unlink($file);
         }
     }
     // we create the folder if it doesn't exist
     if (!is_dir($storage_path = storage_path('app/schedules'))) {
         if (!is_dir($path = storage_path('app'))) {
             mkdir($path);
         }
         mkdir($path . '/schedules');
     }
     // we insert the schedules page content
     $file_name = ImageManager::optimizeAndResize(database_path('seeds/files/schedules/una_schedules.jpg'), config('image.schedules.background_image.name'), 'jpg', config('image.schedules.storage_path'), config('image.schedules.background_image.sizes'), false);
     $inputs = ['title' => 'Horaires et séances encadrées sur l\'eau', 'description' => "### <span class=\"text-primary\"><i class=\"fa fa-bullhorn\"></i> A noter :</span>\r\n- Il est important d'**être en tenue et prêt à ramer** lors du début d'un créneau d'encadrement, afin de profiter au maximum de l'amplitude horaire et de ne pas pénaliser ses équipiers.\r\n- La pratique en autonomie est **strictement interdite**, sauf dérogation nominative délivrée par le Comité Directeur, approuvée par l'équipe d'encadrement.\r\n- Les horaires des séances d'encadrement **évoluent en cours d'année**, merci de visiter régulièrement cette page.", 'background_image' => $file_name];
     file_put_contents(storage_path('app/schedules/content.json'), json_encode($inputs));
     $chedule_repo->createMultiple([['label' => 'Lundi - 12:00 / 13:30 - Tous publics', 'day_id' => config('schedule.day_of_week_key.monday'), 'time_start' => '12:00', 'time_stop' => '13:30', 'public_category' => config('schedule.public_category_key.all_publics'), 'active' => true], ['label' => 'Lundi - 12:00 / 13:30 - SUAPS (étudiants)', 'day_id' => config('schedule.day_of_week_key.monday'), 'time_start' => '12:00', 'time_stop' => '13:30', 'public_category' => config('schedule.public_category_key.suaps'), 'active' => true], ['label' => 'Mardi - 12:00 / 13:30 - Tous publics', 'day_id' => config('schedule.day_of_week_key.tuesday'), 'time_start' => '12:00', 'time_stop' => '13:30', 'public_category' => config('schedule.public_category_key.all_publics'), 'active' => true], ['label' => 'Mardi - 12:30 / 13:30 - SUAPS (étudiants)', 'day_id' => config('schedule.day_of_week_key.tuesday'), 'time_start' => '12:00', 'time_stop' => '13:30', 'public_category' => config('schedule.public_category_key.suaps'), 'active' => true], ['label' => 'Mardi - 14:00 / 15:30 - Tous publics', 'day_id' => config('schedule.day_of_week_key.tuesday'), 'time_start' => '14:00', 'time_stop' => '15:30', 'public_category' => config('schedule.public_category_key.all_publics'), 'active' => true], ['label' => 'Mardi - 14:00 / 15:30 - SUAPS (étudiants)', 'day_id' => config('schedule.day_of_week_key.tuesday'), 'time_start' => '14:00', 'time_stop' => '15:30', 'public_category' => config('schedule.public_category_key.suaps'), 'active' => true], ['label' => 'Mardi - 18:00 / 20:00 - Tous publics', 'day_id' => config('schedule.day_of_week_key.tuesday'), 'time_start' => '18:00', 'time_stop' => '20:00', 'public_category' => config('schedule.public_category_key.all_publics'), 'active' => true], ['label' => 'Mardi - 18:00 / 20:00 - SUAPS (étudiants)', 'day_id' => config('schedule.day_of_week_key.tuesday'), 'time_start' => '18:00', 'time_stop' => '20:00', 'public_category' => config('schedule.public_category_key.suaps'), 'active' => true], ['label' => 'Mardi - 18:00 / 20:00 - École d\'Aviron (- de 18 ans)', 'day_id' => config('schedule.day_of_week_key.tuesday'), 'time_start' => '18:00', 'time_stop' => '20:00', 'public_category' => config('schedule.public_category_key.rowing_school'), 'active' => true], ['label' => 'Mercredi - 12:30 / 13:30 - SUAPS (étudiants)', 'day_id' => config('schedule.day_of_week_key.wednesday'), 'time_start' => '12:00', 'time_stop' => '13:30', 'public_category' => config('schedule.public_category_key.suaps'), 'active' => true], ['label' => 'Mercredi - 14:00 / 16:30 - École d\'Aviron (- de 18 ans)', 'day_id' => config('schedule.day_of_week_key.wednesday'), 'time_start' => '14:00', 'time_stop' => '16:30', 'public_category' => config('schedule.public_category_key.rowing_school'), 'active' => true], ['label' => 'Jeudi - 12:30 / 13:30 - Tous publics', 'day_id' => config('schedule.day_of_week_key.thursday'), 'time_start' => '12:00', 'time_stop' => '13:30', 'public_category' => config('schedule.public_category_key.all_publics'), 'active' => true], ['label' => 'Jeudi - 12:30 / 13:30 - SUAPS (étudiants)', 'day_id' => config('schedule.day_of_week_key.thursday'), 'time_start' => '12:00', 'time_stop' => '13:30', 'public_category' => config('schedule.public_category_key.suaps'), 'active' => true], ['label' => 'Jeudi - 13:30 / 15:30 - SUAPS (étudiants)', 'day_id' => config('schedule.day_of_week_key.thursday'), 'time_start' => '13:30', 'time_stop' => '15:30', 'public_category' => config('schedule.public_category_key.suaps'), 'active' => true], ['label' => 'Jeudi - 15:30 / 17:30 - SUAPS (étudiants)', 'day_id' => config('schedule.day_of_week_key.thursday'), 'time_start' => '15:30', 'time_stop' => '17:30', 'public_category' => config('schedule.public_category_key.suaps'), 'active' => true], ['label' => 'Vendredi - 12:30 / 13:30 - Tous publics', 'day_id' => config('schedule.day_of_week_key.friday'), 'time_start' => '12:00', 'time_stop' => '13:30', 'public_category' => config('schedule.public_category_key.all_publics'), 'active' => true], ['label' => 'Vendredi - 12:30 / 13:30 - SUAPS (étudiants)', 'day_id' => config('schedule.day_of_week_key.friday'), 'time_start' => '12:00', 'time_stop' => '13:30', 'public_category' => config('schedule.public_category_key.suaps'), 'active' => true], ['label' => 'Vendredi - 18:00 / 20:00 - SUAPS (étudiants)', 'day_id' => config('schedule.day_of_week_key.friday'), 'time_start' => '18:00', 'time_stop' => '20:00', 'public_category' => config('schedule.public_category_key.suaps'), 'active' => true], ['label' => 'Vendredi - 18:00 / 20:00 - École d\'Aviron (- de 18 ans)', 'day_id' => config('schedule.day_of_week_key.friday'), 'time_start' => '18:00', 'time_stop' => '20:00', 'public_category' => config('schedule.public_category_key.rowing_school'), 'active' => true], ['label' => 'Samedi - 08:00 / 10:00 - Compétition', 'day_id' => config('schedule.day_of_week_key.saturday'), 'time_start' => '08:00', 'time_stop' => '10:00', 'public_category' => config('schedule.public_category_key.competition'), 'active' => true], ['label' => 'Samedi - 09:00 / 12:00 - Tous publics', 'day_id' => config('schedule.day_of_week_key.saturday'), 'time_start' => '09:00', 'time_stop' => '12:00', 'public_category' => config('schedule.public_category_key.all_publics'), 'active' => true], ['label' => 'Samedi - 14:00 / 16:30 - École d\'Aviron (- de 18 ans)', 'day_id' => config('schedule.day_of_week_key.saturday'), 'time_start' => '14:00', 'time_stop' => '16:30', 'public_category' => config('schedule.public_category_key.rowing_school'), 'active' => true], ['label' => 'Samedi - 15:30 / 17:30 - SUAPS (étudiants)', 'day_id' => config('schedule.day_of_week_key.saturday'), 'time_start' => '15:30', 'time_stop' => '17:30', 'public_category' => config('schedule.public_category_key.suaps'), 'active' => true]]);
 }