Exemple #1
0
 /**
  * updates the whole setting section
  * firsts it renders the input names of the submitted form
  * into database fields
  * it also merge the current settings or update the submitted settings into
  * db .
  * it also use serialization for each fields
  *
  * @param boolean $blogApi
  */
 public static function update($blogApi = false)
 {
     /**
      * set Self::$settings with Applum::find(1)
      */
     self::setSettings();
     /**
      * renders submitted form inputs
      * which is compatible with the database structure
      *
      * IMPORTANT : I have to fine a better place for this one
      */
     DataFormatter::render($blogApi);
     /**
      * updates uploaded file info into database
      */
     AFile::updateFile();
     /**
      * for the sake of serialization there is some boundaries . we can`t
      * change new settings with the current one , we have to maintain the untouched
      * settings and update the touched ones .
      */
     self::use_submitted_info_and_leave_untouch_settings();
     self::$settings->save();
 }
Exemple #2
0
 public static function cropAll(array $images)
 {
     foreach ($images as $image) {
         $image = Utilities::arrayToObject($image);
         $image->name = File::get_file_name_with_its_url($image->url);
         $image->mimeType = Image::mimeType($image->name);
         $image->path = \Crop\Crop::$direction . "/images/" . $image->name;
         $image->savePath = \Crop\Crop::$direction . "/croped/" . "croped-" . $image->name;
         \Crop\Crop::cutIt($image);
     }
 }
Exemple #3
0
 /**
  * generates cropped image link
  *
  * @param $url
  * @return string
  */
 public static function show($url)
 {
     $name = AFile::get_file_name_with_its_url($url);
     return \App\Config\Config::theme() . "/core/app/helpers/Crop/croped/croped-" . $name;
 }