Creates a new resource

@return string HTML output
344987
public function create()
	{
		$view = $this->getView();
		$context = $this->getContext();

		try
		{
			$data = $view->param( 'item', [] );

			if( !isset( $view->item ) ) {
				$view->item = \Aimeos\MShop::create( $context, 'supplier' )->createItem();
			}

			$data['supplier.siteid'] = $view->item->getSiteId();

			$view->itemSubparts = $this->getSubClientNames();
			$view->itemData = $data;
			$view->itemBody = '';

			foreach( $this->getSubClients() as $idx => $client )
			{
				$view->tabindex = ++$idx + 1;
				$view->itemBody .= $client->create();
			}
		}
		catch( \Aimeos\MShop\Exception $e )
		{
			$error = array( 'supplier-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$view->errors = $view->get( 'errors', [] ) + $error;
			$this->logException( $e );
		}
		catch( \Exception $e )
		{
			$error = array( 'supplier-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() );
			$view->errors = $view->get( 'errors', [] ) + $error;
			$this->logException( $e );
		}

		return $this->render( $view );
	}
558606
private function create()
    {
        $response = $this->sendRequest(
            self::METHOD_POST,
            self::$endPoints['create'],
            $this->requestData
        );
        $this->resetRequestData();
        return $response;
    }
697379
public function create()
  {
    $class = ClassGen::classGen(
      $this->entityName . 'Controller',
      $this->namespace,
      ['Phrest\API\Controllers\RESTController'],
      'RESTController'
    );

    foreach ($this->entityDefinition->requests as $requestMethod => $actions)
    {
      foreach ($actions as $actionName => $action)
      {
        if (empty($action))
        {
          continue;
        }

        $getParams = $this->generateGetParamsFromUrl($action->url);
        $postParams = $this->generatePostParams($action);

        $docblock = $this->createDocblockForMethod(
          $requestMethod,
          $action,
          $getParams,
          $postParams
        );

        $method = ClassGen::method($actionName, $getParams, 'public');
        $method->setDocBlock($docblock);

        $body = $this->createBodyForMethod($action);
        $method->setBody($body);

        $class->addMethodFromGenerator($method);
      }
    }

    foreach ($this->uses as $use)
    {
      $class->addUse($use);
    }

    return $class;
  }
429709
public function CreatePage()
	{
		$this->_myWords = $this->WordCollection();

		$title = $this->_myWords->Value("TITLE", $this->_context->get("SERVER_NAME") );
		$abstract = $this->_myWords->Value("ABSTRACT", $this->_context->get("SERVER_NAME") );
		$document = new XmlnukeDocument($title, $abstract);
		
		$this->_url = "module:UserProfile";
				
		$this->_users = $this->getUsersDatabase();
		
		$this->_user = $this->_users->getUserName( $this->_context->authenticatedUser() );
		
		$blockCenterTitle = $this->_myWords->ValueArgs("TITLE", array ($this->_user->getField($this->_users->getUserTable()->username)));
		$blockcenter = new XmlBlockCollection($blockCenterTitle, BlockPosition::Center );
		$document->addXmlnukeObject($blockcenter);
		
		$this->_paragraph = new XmlParagraphCollection();
		$blockcenter->addXmlnukeObject($this->_paragraph);

		$action = $this->_context->get("action");

		switch ($action)
		{
			case "update":
				$this->update();
				break;
			case "changepassword":
				$this->changePWD();
				break;				
		}		
		
		$this->formUserInfo();
		
		$this->formPasswordInfo();
		
		$this->formRolesInfo();	

		return $document->generatePage();
	}
558060
public function actionCreate()
    {
        $request = \Yii::$app->request;
        if ($request->getIsOptions()) {
            return $this->ResponseOptions($this->verbs()['create']);
        }
        try{
            $routes = Yii::$app->getRequest()->post('route', '');
            $routes = preg_split('/\s*,\s*/', trim($routes), -1, PREG_SPLIT_NO_EMPTY);
            $methods = Yii::$app->getRequest()->post('methods', '');
            $model = new Route();
            $model->addNewMethod($routes,$methods);
            return $model->getRoutes();
        }catch(Exception $e){
            throw new Exception($e);
        }

    }
1330484
protected function makeResource()
    {
        /** @var Item|Collection $resource */
        $resource = new $this->resourceClass($this->data, $this->transformer, $this->resourceKey);

        if (!empty($this->meta)) {
            $resource->setMeta($this->meta);
        }

        if ($resource instanceof Collection && isset($this->paginator)) {
            $resource->setPaginator($this->paginator);
        }

        return $resource;
    }
924260
public function actionCreate()
	{
		$post=new Post;
		if(Yii::app()->request->isPostRequest)
		{
			if(isset($_POST['Post']))
				$post->setAttributes($_POST['Post']);
			if($post->save())
				$this->redirect(array('show','id'=>$post->id));
		}
		$this->render('create',array('post'=>$post));
	}
697394
public function create()
    {
        // Keep default options in an array and merge with incoming options that can override the defaults.
        $default = array(
            'id'          => null,
            'class'       => null,
            'wrapper'     => 'nav',
            'create_url'  => function ($url) {
                return $url;
            },
        );
        $menu = array_replace_recursive($default, $this->config);

        // Create the ul li menu from the array, use an anonomous recursive function that returns an
        // array of values.
        $createMenu = function ($items, $callback) use (&$createMenu, $menu) {
            
            $html = null;
            $hasItemIsSelected = false;

            foreach ($items as $item) {

                // has submenu, call recursivly and keep track on if the submenu has a selected item in it.
                $submenu        = null;
                $selectedParent = null;
            
                if (isset($item['submenu'])) {
                    list($submenu, $selectedParent) = $createMenu($item['submenu']['items'], $callback);
                    $selectedParent = $selectedParent
                        ? "selected-parent "
                        : null;
                }

                // Check if the current menuitem is selected
                $selected = $callback($item['url'])
                    ? "selected "
                    : null;
                
                // Check if the menuitem is a parent of current page, /controller for /controller/action
                $isParent = null;
                if (isset($item['mark-if-parent-of']) && $item['mark-if-parent-of'] == true) {
                    $isParent = $menu['is_parent']($item['mark-if-parent-of'])
                        ? "is-parent "
                        : null;
                }
                
                // Is there a class set for this item, then use it
                $class = isset($item['class']) && ! is_null($item['class'])
                    ? $item['class']
                    : null;

                // Prepare the class-attribute, if used
                $class = ($selected || $selectedParent || $isParent || $class)
                    ? " class='{$selected}{$selectedParent}{$isParent}{$class}' "
                    : null;

                // Add the menu item
                $url = $menu['create_url']($item['url']);
                $html .= "\n<li{$class}><a href='{$url}' title='{$item['title']}'>{$item['text']}</a>{$submenu}</li>\n";
                
                // To remember there is selected children when going up the menu hierarchy
                if ($selected) {
                    $hasItemIsSelected = true;
                }
            }

            // Return the menu
            return array("\n<ul>$html</ul>\n", $hasItemIsSelected);
        };

        // Call the anonomous function to create the menu, and submenues if any.
        list($html) = $createMenu($menu['items'], $menu['callback']);


        // Set the id & class element, only if it exists in the menu-array
        $id      = isset($menu['id'])    ? " id='{$menu['id']}'"       : null;
        $class   = isset($menu['class']) ? " class='{$menu['class']}'" : null;
        $wrapper = $menu['wrapper'];

        return "\n<{$wrapper}{$id}{$class}>{$html}</{$wrapper}>\n";
    }
1182985
public function create()
    {
      $data = Ensure::Input(func_get_args());
      $url = URIResource::Make($this->path);
      $id = Locator::Find($this->client->post($url, $data->get()));
      $data->add("id", $id);

      return Constructor::Make($this, $data->get(), TRUE);
    }
1124648
public function actionCreate()
    {
        
        $extensionsToCreate = explode(',', $this->options['extension']);
        $extensionsToCreate = array_unique($extensionsToCreate);
        
        foreach ($extensionsToCreate as $etc){
        	$this->options['extension'] = $etc;
        	$this->options['input'] = dirname(__FILE__) . '/../../' . $etc . '/' . self::DEF_INPUT_DIR;
        	$this->options['output'] = dirname(__FILE__) . '/../../' . $etc . '/' . self::DEF_OUTPUT_DIR;
        	
        	$this->outVerbose("Creating language '" . $this->options['language'] . "' for extension '" . $this->options['extension'] . "' ...");
        	 
        	// We first create the directory where locale files will go.
        	$dir = $this->buildLanguagePath($this->options['extension'], $this->options['language']);
        	$dirExists = false;
        	
        	if (file_exists($dir) && is_dir($dir) && $this->options['force'] == true) {
        		$dirExists = true;
        		$this->outVerbose("Language '" . $this->options['language'] . "' exists for extension '" . $this->options['extension'] . "'. Creation will be forced.");
        		 
        		// Clean it up.
        		foreach (scandir($dir) as $d) {
        			if ($d !== '.' && $d !== '..' && $d !== '.svn') {
        				if (!tao_helpers_File::remove($dir . '/' . $d, true)) {
        					$this->err("Unable to clean up 'language' directory '" . $dir . "'.", true);
        				}
        			}
        		}
        	} else if (file_exists($dir) && is_dir($dir) && $this->options['force'] == false) {
        		$this->err("The 'language' " . $this->options['language'] . " already exists in the file system. Use the 'force' parameter to overwrite it.", true);
        	}
        	
        	// If we are still here... it means that we have to create the language directory.
        	if (!$dirExists && !@mkdir($dir)) {
        		$this->err("Unable to create 'language' directory '" . $this->options['language'] . "'.", true);
        	} else {
        		if ($this->options['build'] == true) {
        			$sortingMethod = tao_helpers_translation_TranslationFile::SORT_ASC_I;
        			$this->outVerbose("Building language '" . $this->options['language'] . "' for extension '" . $this->options['extension'] . "' ...");
        			// Let's populate the language with raw PO files containing sources but no targets.
        			// Source code extraction.
        			$fileExtensions = array('php', 'tpl', 'js', 'ejs');
        			$filePaths = array();
        			foreach (self::$WHITE_LIST as $subFolder) {
        			    $filePaths[] = $this->options['input'] . DIRECTORY_SEPARATOR. $subFolder;
        			}
        			 
        			$sourceExtractor = new tao_helpers_translation_SourceCodeExtractor($filePaths, $fileExtensions);
        			$sourceExtractor->extract();
        	
        			$translationFile = new tao_helpers_translation_POFile();
        			$translationFile->setSourceLanguage(tao_helpers_translation_Utils::getDefaultLanguage());
        			$translationFile->setTargetLanguage($this->options['language']);
        			$translationFile->addTranslationUnits($sourceExtractor->getTranslationUnits());
        			
        			$file = MenuService::getStructuresFilePath($this->options['extension']);
        			if (!is_null($file)) {
            			$structureExtractor = new tao_helpers_translation_StructureExtractor(array($file));
            			$structureExtractor->extract();
            			$translationFile->addTranslationUnits($structureExtractor->getTranslationUnits());
        			}

        			$sortedTus = $translationFile->sortBySource($sortingMethod);
        	
        			$sortedTranslationFile = new tao_helpers_translation_POFile();
        			$sortedTranslationFile->setSourceLanguage(tao_helpers_translation_Utils::getDefaultLanguage());
        			$sortedTranslationFile->setTargetLanguage($this->options['language']);
        			$sortedTranslationFile->addTranslationUnits($sortedTus);
        			$this->preparePOFile($sortedTranslationFile, true);

        			$poPath = $dir . '/' . self::DEF_PO_FILENAME;
        			$writer = new tao_helpers_translation_POFileWriter($poPath,
        					$sortedTranslationFile);
        			$writer->write();
        			$this->outVerbose("PO Translation file '" . basename($poPath) . "' in '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] ."'.");
        			$writer->write();

					// Writing JS files
					$jsPath = $dir . '/' . self::DEF_JS_FILENAME;
        			$writer = new tao_helpers_translation_JSFileWriter(
						 $jsPath, $sortedTranslationFile
					);
        			$writer->write(false);
					$this->outVerbose("JavaScript Translation file '" . basename($jsPath) . "' in '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] ."'.");
					$writer->write();

        			// Now that PO files & JS files are created, we can create the translation models
        			// if we find RDF models to load for this extension.
        			$translatableProperties = array(OntologyRdfs::RDFS_LABEL, OntologyRdfs::RDFS_COMMENT);
        	
        			foreach ($this->getOntologyFiles() as $f){
       					common_Logger::d('reading rdf '.$f);
						$translationFile = $this->extractPoFileFromRDF($f, $translatableProperties);

						$writer = new tao_helpers_translation_POFileWriter($dir . '/' . $this->getOntologyPOFileName($f), $translationFile);
       					$writer->write();

       					$this->outVerbose("PO Translation file '" .  $this->getOntologyPOFileName($f) . "' in '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] . "'.");
        			}
        	
        			$this->outVerbose("Language '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] . "'.");
        		} else {
        			// Only build virgin files.
        			// (Like a virgin... woot !)
        			$translationFile = new tao_helpers_translation_POFile();
        			$translationFile->setSourceLanguage(tao_helpers_translation_Utils::getDefaultLanguage());
        			$translationFile->setTargetLanguage($this->options['language']);
        			$this->preparePOFile($translationFile, true);

        			foreach ($this->getOntologyFiles() as $f){
                            common_Logger::d('reading rdf '.$f);
                            $translationFile = new tao_helpers_translation_POFile();
        					$translationFile->setSourceLanguage(tao_helpers_translation_Utils::getDefaultLanguage());
        					$translationFile->setTargetLanguage($this->options['language']);
        					$translationFile->setExtensionId($this->options['extension']);

						$writer = new tao_helpers_translation_POFileWriter($dir . '/' . $this->getOntologyPOFileName($f), $translationFile);
                        $writer->write();
        			}
        	
        			$this->outVerbose("Language '" . $this->options['language'] . "' created for extension '" . $this->options['extension'] . "'.");
        		}
        	
        		// Create the language manifest in RDF.
        		if ($this->options['extension'] == 'tao'){
        			$langDescription = tao_helpers_translation_RDFUtils::createLanguageDescription($this->options['language'],
        					$this->options['languageLabel']);
        			$langDescription->save($dir . '/' . self::DEF_LANG_FILENAME);
        		}
        	}	
        }
        
    }
873664
public function create() : string
    {
        return $this->prefix . self::createSlug($this->title) . $this->suffix;
    }
271144
public function CreatePage()
	{
		$this->_myWords = $this->WordCollection();

		$this->_document = new XmlnukeDocument($this->_myWords->Value("TITLE", $this->_context->get("SERVER_NAME")),$this->_myWords->Value("ABSTRACT", $this->_context->get("SERVER_NAME")));

		if ($this->_link == "")
		{
			$this->goBack( $this->_myWords->Value("ERRORINVALID") );
		}
		elseif ($this->_action == "submit")
		{
			if (!XmlInputImageValidate::validateText($this->_context))
			{
					$this->goBack( $this->_myWords->Value("OBJECTIMAGEINVALID") );
			}
			else 
			{
				if ( ($this->_toName == "") || ($this->_toEmail == "") || ($this->_fromName == "") || ($this->_fromEmail == "") )
				{
					$this->goBack( $this->_myWords->Value("ERROR") );
				}
				else
				{
					$custMessage = $this->_myWords->Value("MESSAGE", array($this->_toName, $this->_toEmail, urldecode($this->_link), $this->_fromName, $this->_customMessage) );

					MailUtil::Mail
					(
						MailUtil::getEmailFromID(),
						MailUtil::getFullEmailName($this->_toName, $this->_toEmail),
						$this->_myWords->Value("SUBJECT"),
						"",
						$this->_fromEmail,$custMessage
					);

					$this->showMessage();
				}
			}
		}
		else
		{
			$this->showForm();
		}

		return $this->_document->generatePage();		
	}
536496
public static function create()
    {
        $result = new static();
        $result->devBranches = [];
        $result->directoryToParse = '';
        $result->directoryForPlaces = '';
        $result->detectedVersions = [];
        $result->tagToVersionRegexp = '/^(?:v(?:er(?:s(?:ion)?)?)?[.\s]*)?(\d+(?:\.\d+)*)$/';
        $result->setTagFilters(null);

        return $result;
    }
872970
public function actionCreate()
    {
        if (($source = $this->findModel(Yii::$app->request->post('model_id'))) != null) {
            $model = new ArticleComment();
            $model->scenario = ArticleComment::SCENARIO_CREATE;
            if ($model->load(Yii::$app->request->post(), '') && $model->save()) {
                $source->updateCounters(['comments' => 1]);
                if ($model->to_user_id > 0) {
                    //notify(Yii::$app->user->id, $model->to_user_id, 'reply_comment', $source->title, $source->id, $model->content, 'article', $source->id);
                } else {
                    //notify(Yii::$app->user->id, $source->user_id, 'comment_article', $source->title, $source->id, $model->content, 'article', $source->id);
                }
                return $this->renderPartial('detail', ['model' => $model]);
            }
        }
        throw new NotFoundHttpException(Yii::t('yii', 'The requested page does not exist'));
    }
342582
public function actionCreate()
    {
        if (!\Yii::$app->user->can('create'))
            return $this->alert(Module::t('core', 'Access denied.'));

        $model = new Rubric();
        $request = \Yii::$app->getRequest();
        $loaded = $model->load($request->post());
        
        // prependTo() call validate() and save()
        if ($loaded && $model->prependTo($this->findModel($model->parent_node))) {
            return $this->redirect(['index']);
        } else {
            return $this->renderAjax('create', [
                'model' => $model,
            ]);
        }
    }
528748
public function create() 
    {
        try {            
            $fileData['alias'] = Input::get('filename') ? Input::get('filename') : date('m.d.Y - G:i:s');
            $fileData['type'] = 'folder';
            if(Input::get('pid') > 0) {
                $fileData['parent_id'] = Input::get('pid');
            }
            
            $this->file->create($fileData);

            return response()->json([
                'status' => 'success'
            ]);
        }
        
        catch (Exception $e) {
            return $this->handleError($e);
        }
    }
1199176
public function create()
    {
        $type = NodeType::getByHandle('file');
        if (!is_object($type)) {
            NodeType::add('file');
        }
        $type = NodeType::getByHandle('file_folder');
        if (!is_object($type)) {
            NodeType::add('file_folder');
        }
        $type = NodeType::getByHandle('search_preset');
        if (!is_object($type)) {
            NodeType::add('search_preset');
        }
        $type = TreeType::getByHandle('file_manager');
        if (!is_object($type)) {
            TreeType::add('file_manager');
        }

        $manager = FileManager::get();
        if (!is_object($manager)) {
            $manager = FileManager::add();
        }

        return $manager;
    }