Example #1
0
 /**
  * attempt to create the uploads directory
  *
  * sets an error if it fails
  * 
  * @param string $dir the name of the new directory
  */
 public static function _make_uploads_dir($dir = '')
 {
     $dir = empty($dir) ? Participants_Db::files_location() : $dir;
     $savedmask = umask(0);
     $status = true;
     if (mkdir(Participants_Db::app_base_path() . $dir, 0755, true) === false) {
         if (is_object(self::$validation_errors)) {
             self::$validation_errors->add_error('', sprintf(__('The uploads directory (%s) could not be created.', 'participants-database'), $dir));
         }
         $status = false;
     }
     umask($savedmask);
     return $status;
 }
 /**
  * supplies the absolute path to the files location
  * 
  * @return string
  */
 public static function files_uri()
 {
     return trailingslashit(site_url(Participants_Db::files_location()));
 }