コード例 #1
0
 /**
  * Setter
  * Sets value to an attribute for the content node.
  * All "classic" attributes can be used (See {@link eZContentObjectTreeNode::definition()}).
  * If attribute doesn't exist, will throw an exception
  * @param $name Attribute name
  * @param $value Attribute value
  * @throws ezcBasePropertyNotFoundException
  * @return void
  */
 public function __set($name, $value)
 {
     $this->getNode();
     if (!$this->node->hasAttribute($name)) {
         throw new ezcBasePropertyNotFoundException($name);
     }
     $this->node->setAttribute($name, $value);
 }
コード例 #2
0
 function setAttribute($attr, $value)
 {
     switch ($attr) {
         case 'language_code':
             $this->CurrentLanguage = $value;
             break;
         default:
             if (in_array($attr, $this->LocalAttributeNameList)) {
                 $this->LocalAttributeValueList[$attr] = $value;
             } else {
                 eZContentObjectTreeNode::setAttribute($attr, $value);
             }
     }
 }
コード例 #3
0
$pathString = '';
$pathIdentificationString = '';
$requestedURIString = '';
$depth = 2;
if (isset($parentNodeObject) && is_object($parentNodeObject)) {
    $pathString = $parentNodeObject->attribute('path_string') . $virtualNodeID . '/';
    $pathIdentificationString = $parentNodeObject->attribute('path_identification_string');
    //TODO add current node ident string.
    $depth = $parentNodeObject->attribute('depth') + 1;
    $requestedURIString = $parentNodeObject->attribute('url_alias');
}
if (isset($node) && is_object($node)) {
    $requestedURIString = $node->attribute('url_alias');
}
$node = new eZContentObjectTreeNode();
$node->setAttribute('contentobject_version', $EditVersion);
$node->setAttribute('path_identification_string', $pathIdentificationString);
$node->setAttribute('contentobject_id', $ObjectID);
$node->setAttribute('parent_node_id', $parentNodeID);
$node->setAttribute('main_node_id', $virtualNodeID);
$node->setAttribute('path_string', $pathString);
$node->setAttribute('depth', $depth);
$node->setAttribute('node_id', $virtualNodeID);
$node->setAttribute('sort_field', $class->attribute('sort_field'));
$node->setAttribute('sort_order', $class->attribute('sort_order'));
$node->setAttribute('remote_id', eZRemoteIdUtility::generate('node'));
$node->setName($objectName);
$node->setContentObject($contentObject);
if ($Params['SiteAccess']) {
    $siteAccess = htmlspecialchars($Params['SiteAccess']);
} else {
コード例 #4
0
 function customObjectAttributeHTTPAction($http, $action, $contentObjectAttribute, $parameters)
 {
     switch ($action) {
         case "send_preview":
             $module = $parameters['module'];
             var_dump($module->obj);
             //viewData() );
             var_dump($obj);
             /*
                       $classAttribute = $contentObjectAttribute->contentClassAttribute();
                       var_dump($http);
                       var_dump($action);
                       var_dump($contentObjectAttribute);
                       var_dump
                       //$classAttribute = $contentObjectAttribute->contentClassAttribute();
                       //$module = $classAttribute->currentModule();
                       $module = $parameters['module'];
                       //var_dump($module);
                       
                       //var_dump($parameters);
                       $ObjectVersion = 26;
                       $ObjectID = 99;
                       $contentObject = ezContentObjectVersion::fetchVersion(  $ObjectVersion ,$ObjectID);
                       
                       $tpl =& templateInit();
                       $tpl->setVariable('object', $contentObject);
                       //$tpl->setVariable('newsletter', $newsletter);
                       $tpl->fetch( 'design:eznewsletter/newsletter_preview.tpl' );
             */
             /*
                     $cacheFileArray = array( 'cache_dir' => false, 'cache_path' => false );
                     $NodeID = 101;
                     
             //$Module = $Params['Module'];
             $tpl = templateInit();
             $LanguageCode = $Params['Language'];
             $ViewMode = "full";
             $Offset = $Params['Offset'];
             //$ini = eZINI::instance();
             $Year = $Params['Year'];
             $Month = $Params['Month'];
             $Day = $Params['Day'];
             $viewParameters = array( 'offset' => $Offset,
                                            'year' => $Year,
                                            'month' => $Month,
                                            'day' => $Day,
                                            'namefilter' => false );
             $viewParameters = array_merge( $viewParameters, $UserParameters );
             $collectionAttributes = false;
                   if ( isset( $Params['CollectionAttributes'] ) )
                     $collectionAttributes = $Params['CollectionAttributes'];
                   
                   $validation = array( 'processed' => false, 'attributes' => array() );
             
                   if ( isset( $Params['AttributeValidation'] ) )
                     $validation = $Params['AttributeValidation'];
                     
                   $localVars = array( "cacheFileArray", "NodeID",  "Module", "tpl",
                                           "LanguageCode",  "ViewMode", "Offset", "ini",
                                           "cacheFileArray", "viewParameters", "collectionAttributes",
                                           "validation" );
             
             
              
             
                     $args = compact( $localVars );
             
                     // the false parameter will disable generation of the 'binarydata' entry
                     $data = eZNodeviewfunctions::contentViewGenerate( false, $args ); 
             */
             $tpl = templateInit();
             $EditVersion = 26;
             $pathIdentificationString = "";
             $ObjectID = 99;
             $parentNodeID = 2;
             $virtualNodeID = null;
             $pathString = "";
             $depth = 2;
             $objectName = "OMG";
             $node = new eZContentObjectTreeNode();
             $node->setAttribute('contentobject_version', $EditVersion);
             $node->setAttribute('path_identification_string', $pathIdentificationString);
             $node->setAttribute('contentobject_id', $ObjectID);
             $node->setAttribute('parent_node_id', $parentNodeID);
             $node->setAttribute('main_node_id', $virtualNodeID);
             $node->setAttribute('path_string', $pathString);
             $node->setAttribute('depth', $depth);
             $node->setAttribute('node_id', $virtualNodeID);
             //$node->setAttribute( 'sort_field', $class->attribute( 'sort_field' ) );
             //$node->setAttribute( 'sort_order', $class->attribute( 'sort_order' ) );
             $node->setName($objectName);
             $node->setContentObject($contentObject);
             $contentObject = null;
             $LanguageCode = null;
             $viewParameters = array();
             $contentObject = eZContentObject::fetch($ObjectID);
             $Result = eZNodeviewfunctions::generateNodeViewData($tpl, $node, $contentObject, $LanguageCode, 'full', 0);
             var_dump($Result);
             //var_dump( $module->run("versionview") );
             $contentObjectAttribute->setValidationError(ezi18n('kernel/classes/datatypes', 'The email address is not valid.'));
     }
 }
コード例 #5
0
$pathString = '';
$pathIdentificationString = '';
$requestedURIString = '';
$depth = 2;
if (isset($parentNodeObject) && is_object($parentNodeObject)) {
    $pathString = $parentNodeObject->attribute('path_string') . $virtualNodeID . '/';
    $pathIdentificationString = $parentNodeObject->attribute('path_identification_string');
    //TODO add current node ident string.
    $depth = $parentNodeObject->attribute('depth') + 1;
    $requestedURIString = $parentNodeObject->attribute('url_alias');
}
if (isset($node) && is_object($node)) {
    $requestedURIString = $node->attribute('url_alias');
}
$node = new eZContentObjectTreeNode();
$node->setAttribute('contentobject_version', $EditVersion);
$node->setAttribute('path_identification_string', $pathIdentificationString);
$node->setAttribute('contentobject_id', $ObjectID);
$node->setAttribute('parent_node_id', $parentNodeID);
$node->setAttribute('main_node_id', $virtualNodeID);
$node->setAttribute('path_string', $pathString);
$node->setAttribute('depth', $depth);
$node->setAttribute('node_id', $virtualNodeID);
$node->setAttribute('sort_field', $class->attribute('sort_field'));
$node->setAttribute('sort_order', $class->attribute('sort_order'));
$node->setAttribute('remote_id', md5((string) mt_rand() . (string) time()));
$node->setName($objectName);
$node->setContentObject($contentObject);
if ($Params['SiteAccess']) {
    $siteAccess = $Params['SiteAccess'];
} else {