本文整理汇总了PHP中FileSet::createAndGetSet方法的典型用法代码示例。如果您正苦于以下问题:PHP FileSet::createAndGetSet方法的具体用法?PHP FileSet::createAndGetSet怎么用?PHP FileSet::createAndGetSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSet
的用法示例。
在下文中一共展示了FileSet::createAndGetSet方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
public function install()
{
$pkg = parent::install();
$setless_fs = FileSet::getByName('Setless');
if (empty($setless_fs)) {
$setless_fs = FileSet::createAndGetSet('Setless', 1);
}
}
示例2:
case '1':
// do nothing
break;
case '2':
foreach($files as $f) {
$fs->addFileToSet($f);
}
break;
}
}
}
}
if ($_POST['fsNew']) {
$type = ($_POST['fsNewShare'] == 1) ? FileSet::TYPE_PUBLIC : FileSet::TYPE_PRIVATE;
$fs = FileSet::createAndGetSet($_POST['fsNewText'], $type);
//print_r($fs);
foreach($files as $f) {
$fs->addFileToSet($f);
}
}
exit;
}
?>
<script type="text/javascript">
$(function() {
ccm_alSetupSetsForm('<?php
echo $searchInstance;
?>
');
示例3: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
Loader::model('file_set');
$file_set = FileSet::createAndGetSet('Starred Files', FileSet::TYPE_STARRED);
$f = File::getByID($_POST['file-id']);
$fp = new Permissions($f);
if (!$fp->canRead()) {
die(_("Access Denied."));
}
switch ($_POST['action']) {
case 'star':
$file_set->AddFileToSet($_POST['file-id']);
break;
case 'unstar':
$file_set->RemoveFileFromSet($_POST['file-id']);
break;
default:
throw new Exception('INVALID ACTION');
}
示例4: add
public static function add($name, $searchRequest, $searchColumnsObject) {
$fs = parent::createAndGetSet($name, FileSet::TYPE_SAVED_SEARCH);
$db = Loader::db();
$v = array($fs->getFileSetID(), serialize($searchRequest), serialize($searchColumnsObject));
$db->Execute('insert into FileSetSavedSearches (fsID, fsSearchRequest, fsResultColumns) values (?, ?, ?)', $v);
return $fs;
}
示例5: t
}
if (!$validExtension) {
$error[] = t('Invalid File Extension');
}
}
if (count($error) > 0) {
// send in the errors
$errorStr = implode(', ', $error);
$file->error = $errorStr . '.';
echo Loader::helper('json')->encode($file);
exit;
}
// -- end intitial validation -- //
// begin file import
$fi = new FileImporter();
$fv = $fi->import($_FILES["file"]["tmp_name"], $_FILES["file"]["name"]);
if (!$fv instanceof \Concrete\Core\Entity\File\Version) {
$file->error = $fi->getErrorMessage($fv);
$file->timestamp = $_POST['timestamp'];
} else {
$file_set = Config::get('conversations.attachments_pending_file_set');
$fs = FileSet::getByName($file_set);
if (!is_object($fs)) {
$fs = FileSet::createAndGetSet($file_set, FileSet::TYPE_PUBLIC, USER_SUPER_ID);
}
$fs->addFileToSet($fv);
$file->id = $fv->getFileID();
$file->tag = $_POST['tag'];
$file->timestamp = $_POST['timestamp'];
}
echo Loader::helper('json')->encode($file);
示例6: step5
public function step5()
{
Loader::model('file_set');
Loader::model('file_list');
$response = new JSONResponse();
$response->setStatus(false);
$user = $this->post("user");
$repos = $this->post("repos");
$file = $this->post("file");
$plugin = new PluginArchive();
$pluginDir = $plugin->unzip($file);
$u = new User();
$fs = FileSet::createAndGetSet($repos, 1, $u->getUserID());
$importer = new MootoolsPluginImporter($fs);
$importFiles = $importer->getComponentFiles($pluginDir . "/Source/");
$resultFiles = array();
foreach ($importFiles as $file) {
$result = $importer->canImport($file);
if ($result) {
$resultFiles[$file] = $importer->addFile($file);
}
}
$response->setMessage(t("Plugin taking was completed."));
$response->setParameter("files", $resultFiles);
$response->setStatus(true);
$response->flush();
}
示例7: buildSiteFromWordPress
function buildSiteFromWordPress(array $pages)
{
Loader::model('page');
//this creates the fileset and sets it as a protected property of this controller class so we can reference it without throwing these defines around, i'll get rid of em
//eventually
if ($this->createFileSet) {
Loader::model('file_set');
$fs = new FileSet();
$u = new User();
$uID = User::getUserID();
$newFs = FileSet::createAndGetSet($this->filesetname, 1, $uID);
$this->fileset = $newFs;
}
$errors = array();
//$message = '';
//get our root page
$pageroot = Page::getByID($this->post('new-root-pages'));
$postroot = Page::getByID($this->post('new-root-posts'));
//this is how / where to set another page for page-type pages.
//ok so basically our keys in our array are wordpress postIDs, which are pages in the system
//so what we need to do now (thinking here) is that we need to arrange these posts into a tree
//$pages is in the format of the postID => pageLiteObject
Loader::model('collection_types');
$ctPagesID = CollectionType::getByID($this->post('wordpress-pages'));
$ctBlogID = CollectionType::getByID($this->post('wordpress-blogs'));
//we want to reference the collection type we are adding based on either a post or a page
$collectionTypesForWordpress = array("POST" => $ctBlogID, "PAGE" => $ctPagesID);
$parentIDPageLiteRel = array();
$createdPages = array();
$createdPagesReal = array();
$fakeCreatedPages = array();
//so our homepage is zero, and we need that in our created page, even though it isn't a page that is created for association issues but it absolutely has to be 0.
//Then it is a relational mapping issue, this puppy took a bit of thought
//
$createdPagesReal[0] = $pageroot;
//so foreach pages
foreach ($pages as $xmlID => $pageLite) {
$ct = $collectionTypesForWordpress[$pageLite->getPostType()];
//create the pages
//right now i am only handling posts and pages, we have to ignore attachments as they are posted elsewhere or referenced in posts or pages
if (is_a($ct, CollectionType)) {
if ($pageLite->getPostType() == "POST") {
$createdPagesReal[$pageLite->getPostID()] = $this->addWordpressPage($postroot, $ct, $pageLite, $xmlID);
} else {
$createdPagesReal[$pageLite->getPostID()] = $this->addWordpressPage($pageroot, $ct, $pageLite, $xmlID);
}
//here's how we map our pages to pages
} else {
//this is kind of spooky and frustrating to see.
$errors[] = t("Un-supported post type for post - ") . $pageLite->getTitle();
}
}
$this->set('message', t('Wordpress export pages imported under ') . $pageroot->getCollectionName() . ".<br /> " . t('Wordpress export posts imported under ') . $postroot->getCollectionName() . ".");
$this->set('errors', $errors);
}