protected function setUp()
 {
     $this->tables = array_merge($this->tables, array('Files', 'FileVersions', 'Users', 'PermissionAccessEntityTypes', 'FileAttributeValues', 'FileImageThumbnailTypes', 'FilePermissionAssignments', 'AttributeKeyCategories', 'AttributeTypes', 'ConfigStore', 'AttributeKeys', 'SystemContentEditorSnippets', 'AttributeValues', 'atNumber', 'FileVersionLog'));
     parent::setUp();
     define('UPLOAD_FILE_EXTENSIONS_ALLOWED', '*.txt;*.jpg;*.jpeg;*.png');
     Category::add('file');
     $number = AttributeType::add('number', 'Number');
     FileKey::add($number, array('akHandle' => 'width', 'akName' => 'Width'));
     FileKey::add($number, array('akHandle' => 'height', 'akName' => 'Height'));
     CacheLocal::flush();
 }
예제 #2
0
 protected function setUp()
 {
     $this->tables = array_merge($this->tables, array('Files', 'FileVersions', 'Users', 'PermissionAccessEntityTypes', 'FileAttributeValues', 'FileImageThumbnailTypes', 'FilePermissionAssignments', 'AttributeKeyCategories', 'AttributeTypes', 'ConfigStore', 'AttributeKeys', 'AttributeValues', 'atNumber', 'Logs', 'FileVersionLog'));
     parent::setUp();
     Config::set('concrete.upload.extensions', '*.txt;*.jpg;*.jpeg;*.png');
     $category = Category::add('file');
     $number = AttributeType::add('number', 'Number');
     FileKey::add($number, array('akHandle' => 'width', 'akName' => 'Width'));
     FileKey::add($number, array('akHandle' => 'height', 'akName' => 'Height'));
     CacheLocal::flush();
 }
예제 #3
0
 protected function setUp()
 {
     $this->tables = array_merge($this->tables, array('Files', 'FileVersions', 'Users', 'PermissionAccessEntityTypes', 'FileAttributeValues', 'AttributeKeyCategories', 'AttributeSetKeys', 'Packages', 'AttributeSets', 'FileImageThumbnailTypes', 'AttributeTypes', 'ConfigStore', 'AttributeKeys', 'AttributeValues', 'FileSets', 'atNumber', 'FileVersionLog', 'FileSetFiles'));
     parent::setUp();
     \Config::set('concrete.upload.extensions', '*.txt;*.jpg;*.jpeg;*.png');
     Category::add('file');
     \Concrete\Core\Permission\Access\Entity\Type::add('file_uploader', 'File Uploader');
     $number = AttributeType::add('number', 'Number');
     FileKey::add($number, array('akHandle' => 'width', 'akName' => 'Width'));
     FileKey::add($number, array('akHandle' => 'height', 'akName' => 'Height'));
     mkdir($this->getStorageDirectory());
     $this->getStorageLocation();
     $sample = dirname(__FILE__) . '/StorageLocation/fixtures/sample.txt';
     $image = DIR_BASE . '/concrete/images/logo.png';
     $fi = new Importer();
     $files = array('sample1.txt' => $sample, 'sample2.txt' => $sample, 'sample4.txt' => $sample, 'sample5.txt' => $sample, 'awesome.txt' => $sample, 'testing.txt' => $sample, 'logo1.png' => $image, 'logo2.png' => $image, 'logo3.png' => $image, 'foobley.png' => $image, 'test.png' => $image);
     foreach ($files as $filename => $pointer) {
         $fi->import($pointer, $filename);
     }
     $this->list = new \Concrete\Core\File\FileList();
     $this->list->ignorePermissions();
 }
 public function publish(AttributeKey $ak, Package $pkg = null)
 {
     $key = FileKey::add($ak->getType(), array('akHandle' => $ak->getHandle(), 'akName' => $ak->getName(), 'akIsInternal' => $ak->getIsInternal(), 'akIsSearchableIndexed' => $ak->getIsIndexed(), 'akIsSearchable' => $ak->getIsSearchable()), $pkg);
     return $key;
 }
 private function addFileAttributeKeys($pkg)
 {
     $att = FileAttributeKey::getByHandle("db_table_demo");
     if (!$att) {
         FileAttributeKey::add('db_table_demo', array('akHandle' => 'db_table_demo', 'akName' => t('Database Table Tutorial Demo'), 'akIsSearchable' => true), $pkg);
     }
 }