• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP node_object_prepare函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中node_object_prepare函数的典型用法代码示例。如果您正苦于以下问题:PHP node_object_prepare函数的具体用法?PHP node_object_prepare怎么用?PHP node_object_prepare使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了node_object_prepare函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: nodeCreate

 /**
  * {@inheritdoc}
  */
 public function nodeCreate($node)
 {
     $current_path = getcwd();
     chdir(DRUPAL_ROOT);
     // Set original if not set.
     if (!isset($node->original)) {
         $node->original = clone $node;
     }
     // Assign authorship if none exists and `author` is passed.
     if (!isset($node->uid) && !empty($node->author) && ($user = user_load(array('name' => $node->author)))) {
         $node->uid = $user->uid;
     }
     // Convert properties to expected structure.
     $this->expandEntityProperties($node);
     // Attempt to decipher any fields that may be specified.
     $this->expandEntityFields('node', $node);
     // Set defaults that haven't already been set.
     $defaults = clone $node;
     module_load_include('inc', 'node', 'node.pages');
     node_object_prepare($defaults);
     $node = (object) array_merge((array) $defaults, (array) $node);
     node_save($node);
     chdir($current_path);
     return $node;
 }
开发者ID:acbramley,项目名称:DrupalDriver,代码行数:28,代码来源:Drupal6.php


示例2: new_empty_node

function new_empty_node($title, $bundle_type, $extra = NULL, $lang = LANGUAGE_NONE)
{
    $node = new stdClass();
    $node->type = $bundle_type;
    $node->language = $lang;
    // und
    $node->status = 1;
    // published
    $node->is_new = true;
    $node->title = $title;
    if (!empty($extra)) {
        foreach ($extra as $k => $v) {
            $node->{$k} = $v;
        }
    }
    node_object_prepare($node);
    node_save($node);
    ft_table_insert($node);
    // defined in expsearch.admin.inc
    return $node;
    /*
    $records = db_query("SELECT max(nid) as nid FROM node");
    $nid = 0;
    foreach($records as $record) { $nid = $record->nid; }
    return $nid;
    */
}
开发者ID:318io,项目名称:318-io,代码行数:27,代码来源:easier.drupal.php


示例3: insert_door_to_drupal

 function insert_door_to_drupal($door_id)
 {
     // set HTTP_HOST or drupal will refuse to bootstrap
     $_SERVER['HTTP_HOST'] = 'zl-apps';
     $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
     include_once DRUPAL_ROOT . '/includes/bootstrap.inc';
     drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
     $door = new Door();
     $door_detail = $door->read(null, $door_id);
     $door_nid = null;
     $query = new EntityFieldQuery();
     $entities = $query->entityCondition('entity_type', 'node')->entityCondition('bundle', 'doors')->propertyCondition('status', 1)->fieldCondition('field_door_id', 'value', $door_detail['Door']['id'], '=')->execute();
     foreach ($entities['node'] as $nid => $value) {
         $door_nid = $nid;
         break;
         // no need to loop more even if there is multiple (it is supposed to be unique
     }
     $node = null;
     if (is_null($door_nid)) {
         $node = new stdClass();
         $node->language = LANGUAGE_NONE;
     } else {
         $node = node_load($door_nid);
     }
     $node->type = 'doors';
     node_object_prepare($node);
     $node->title = $door_detail['Door']['door_style'];
     $node->field_door_id[$node->language][0]['value'] = $door_detail['Door']['id'];
     $node->sell_price = 0;
     $node->model = $door_detail['Door']['door_style'];
     $node->shippable = 1;
     $path = 'door/' . $node->title;
     $node->path = array('alias' => $path);
     node_save($node);
 }
开发者ID:khaled-saiful-islam,项目名称:zen_v1.0,代码行数:35,代码来源:Door.php


示例4: __construct

 /**
  * Default constructor for the node object. Do not call this class directly.
  * Create a separate class for each content type and use its constructor.
  *
  * @param int $nid
  *   Nid if an existing node is to be loaded.
  */
 public function __construct($nid = NULL)
 {
     $class = new \ReflectionClass(get_called_class());
     $type = Utils::makeSnakeCase($class->getShortName());
     if (!is_null($nid) && is_numeric($nid)) {
         $node = node_load($nid);
         if (!$node) {
             $this->setErrors("Node with nid {$nid} does not exist.");
             $this->setInitialized(FALSE);
             return;
         }
         if ($node->type != $type) {
             $this->setErrors("Node's type doesn't match the class.");
             $this->setInitialized(FALSE);
             return;
         }
         parent::__construct($node);
     } else {
         global $user;
         $node = (object) array('title' => NULL, 'type' => $type, 'language' => LANGUAGE_NONE, 'is_new' => TRUE, 'name' => $user->name);
         node_object_prepare($node);
         parent::__construct($node);
     }
     $this->setInitialized(TRUE);
 }
开发者ID:redcrackle,项目名称:redtest-core,代码行数:32,代码来源:Node.php


示例5: entityPreSave

 /**
  * Overrides RestfulEntityBase::entityPreSave().
  *
  * Set the node author and other defaults.
  */
 public function entityPreSave(\EntityMetadataWrapper $wrapper) {
   $node = $wrapper->value();
   if (!empty($node->nid)) {
     // Node is already saved.
     return;
   }
   node_object_prepare($node);
   $node->uid = $this->getAccount()->uid;
 }
开发者ID:humanitarianresponse,项目名称:site,代码行数:14,代码来源:RestfulEntityBaseNode.php


示例6: handleDocumentInfo

 function handleDocumentInfo($DocInfo)
 {
     $this->urls_processed[$DocInfo->http_status_code][] = $DocInfo->url;
     if (200 != $DocInfo->http_status_code) {
         return;
     }
     $nid = db_select('field_data_field_sitecrawler_url', 'fdfsu')->fields('fdfsu', array('entity_id'))->condition('fdfsu.field_sitecrawler_url_url', $DocInfo->url)->execute()->fetchField();
     if (!!$nid) {
         $node = node_load($nid);
         $this->nodes_updated++;
     } else {
         $node = new stdClass();
         $node->type = 'sitecrawler_page';
         node_object_prepare($node);
         $this->nodes_created++;
     }
     $node->title = preg_match('#<head.*?<title>(.*?)</title>.*?</head>#is', $DocInfo->source, $matches) ? $matches[1] : $DocInfo->url;
     $node->language = LANGUAGE_NONE;
     $node->field_sitecrawler_url[$node->language][0]['title'] = $node->title;
     $node->field_sitecrawler_url[$node->language][0]['url'] = $DocInfo->url;
     //     $node->field_sitecrawler_summary[$node->language][0]['value'] =
     // drupal_set_message('<pre style="border: 1px solid red;">body_xpaths: ' . print_r($this->body_xpaths,1) . '</pre>');
     $doc = new DOMDocument();
     $doc->loadHTML($DocInfo->source);
     foreach ($this->body_xpaths as $body_xpath) {
         $xpath = new DOMXpath($doc);
         // $body = $xpath->query('/html/body');
         // $body = $xpath->query('//div[@id="layout"]');
         $body = $xpath->query($body_xpath);
         if (!is_null($body)) {
             foreach ($body as $i => $element) {
                 $node_body = $element->nodeValue;
                 if (!empty($node_body)) {
                     break 2;
                 }
             }
         }
     }
     if (empty($node_body)) {
         $node_body = preg_match('#<body.*?>(.*?)</body>#is', $DocInfo->source, $matches) && !empty($matches[1]) ? $matches[1] : $DocInfo->source;
     }
     $node_body = mb_check_encoding($node_body, 'UTF-8') ? $node_body : utf8_encode($node_body);
     $node->body[$node->language][0]['value'] = $node_body;
     $node->body[$node->language][0]['summary'] = text_summary($node_body);
     $node->body[$node->language][0]['format'] = filter_default_format();
     // store the Drupal crawler ID from the opensanmateo_sitecrawler_sites table
     $node->field_sitecrawler_id[$node->language][0]['value'] = $this->crawler_id;
     // store the PHPCrawler ID for this pull of the site
     $node->field_sitecrawler_instance_id[$node->language][0]['value'] = $this->getCrawlerId();
     node_save($node);
     $this->{'nodes_' . (!!$nid ? 'updated' : 'created')}[$node->nid] = $node->title . ' :: ' . $DocInfo->url;
 }
开发者ID:anselmbradford,项目名称:OpenSanMateo,代码行数:52,代码来源:SiteCrawler.class.php


示例7: testConfigurationForm

 function testConfigurationForm()
 {
     // We need a real node because webform_component_edit_form() uses it.
     $node = (object) array('type' => 'webform');
     node_object_prepare($node);
     $node->webform['components'] = $this->components;
     node_save($node);
     $form = FormBuilderWebformForm::loadFromStorage('webform', $node->nid, 'the-sid', array());
     $form_state = array();
     $element = $form->getElement('cid_2');
     $a = $element->configurationForm(array(), $form_state);
     $this->assertEqual(array('#_edit_element' => array('#webform_component' => array('nid' => $node->nid, 'cid' => '2', 'pid' => '0', 'form_key' => 'textfield1', 'name' => 'textfield1', 'type' => 'textfield', 'value' => 'textfield1', 'extra' => array('title_display' => 'before', 'private' => 0, 'disabled' => 1, 'unique' => 0, 'conditional_operator' => '=', 'width' => '4', 'maxlength' => '', 'field_prefix' => 'testprefix', 'field_suffix' => 'testpostfix', 'description' => '', 'attributes' => array(), 'conditional_component' => '', 'conditional_values' => ''), 'mandatory' => '0', 'weight' => '1', 'page_num' => 1), '#weight' => '1', '#key' => 'textfield1', '#form_builder' => array('element_id' => 'cid_2', 'parent_id' => 0, 'element_type' => 'textfield', 'form_type' => 'webform', 'form_id' => $node->nid, 'configurable' => TRUE, 'removable' => TRUE)), 'size' => array('#form_builder' => array('property_group' => 'display'), '#type' => 'textfield', '#size' => 6, '#title' => 'Size', '#default_value' => '4', '#weight' => 2, '#maxlength' => 5, '#element_validate' => array(0 => 'form_validate_integer')), 'maxlength' => array('#form_builder' => array('property_group' => 'validation'), '#type' => 'textfield', '#size' => 6, '#title' => 'Max length', '#default_value' => '', '#field_suffix' => ' characters', '#weight' => 3, '#maxlength' => 7, '#element_validate' => array(0 => 'form_validate_integer')), 'field_prefix' => array('#form_builder' => array('property_group' => 'display'), '#type' => 'textfield', '#title' => 'Prefix', '#default_value' => 'testprefix', '#weight' => -2), 'field_suffix' => array('#form_builder' => array('property_group' => 'display'), '#type' => 'textfield', '#title' => 'Suffix', '#default_value' => 'testpostfix', '#weight' => -1), 'disabled' => array('#form_builder' => array('property_group' => 'display'), '#title' => 'Disabled (read-only)', '#type' => 'checkbox', '#default_value' => TRUE, '#weight' => 12), 'unique' => array('#form_builder' => array('property_group' => 'validation'), '#title' => 'Unique', '#description' => 'Check that all entered values for this field are unique. The same value is not allowed to be used twice.', '#type' => 'checkbox', '#default_value' => 0), 'title' => array('#title' => 'Title', '#type' => 'textfield', '#default_value' => 'textfield1', '#maxlength' => 255, '#required' => TRUE, '#weight' => -10), 'title_display' => array('#type' => 'select', '#title' => 'Label display', '#default_value' => 'before', '#options' => array('before' => 'Above', 'inline' => 'Inline', 'none' => 'None'), '#description' => 'Determines the placement of the component\'s label.', '#weight' => 8, '#tree' => TRUE, '#form_builder' => array('property_group' => 'display')), 'default_value' => array('#type' => 'textfield', '#title' => 'Default value', '#default_value' => 'textfield1', '#weight' => 1), 'description' => array('#title' => 'Description', '#type' => 'textarea', '#default_value' => '', '#weight' => 5), 'webform_private' => array('#type' => 'checkbox', '#title' => 'Private', '#default_value' => FALSE, '#description' => 'Private fields are shown only to users with results access.', '#weight' => 45, '#disabled' => TRUE, '#tree' => TRUE, '#form_builder' => array('property_group' => 'display')), 'required' => array('#form_builder' => array('property_group' => 'validation'), '#title' => 'Required', '#type' => 'checkbox', '#default_value' => '0', '#weight' => -1), 'key' => array('#title' => 'Form key', '#type' => 'machine_name', '#default_value' => 'textfield1', '#maxlength' => 128, '#description' => 'The form key is used in the field "name" attribute. Must be alphanumeric and underscore characters.', '#machine_name' => array('source' => array(0 => 'title'), 'label' => 'Form key'), '#weight' => -9, '#element_validate' => array(0 => 'form_builder_property_key_form_validate')), 'weight' => array('#form_builder' => array('property_group' => 'hidden'), '#type' => 'textfield', '#size' => 6, '#title' => 'Weight', '#default_value' => '1')), $a);
 }
开发者ID:TeamTriplo,项目名称:triplo-build,代码行数:13,代码来源:FormBuilderWebformFormTest.php


示例8: addNode

function addNode($title, $content, $date)
{
    $node = new stdClass();
    $node->type = 'test_perf_1';
    node_object_prepare($node);
    $node->language = LANGUAGE_NONE;
    $node->uid = 1;
    $node->changed_by = 1;
    $node->status = 1;
    $node->created = time() - mt_rand(1000, 1451610061);
    $node->title = $title;
    $node->body[LANGUAGE_NONE][0] = array('value' => $content, 'format' => 'full_html');
    $node->field_test_date[LANGUAGE_NONE][0] = array('value' => $date, 'timezone' => 'UTC', 'timezone_db' => 'UTC');
    node_save($node);
}
开发者ID:cherouvim,项目名称:test-drupal-perf-1,代码行数:15,代码来源:add-dummy-content.php


示例9: __construct

 /**
  * Constructor that wraps the entity.
  */
 public function __construct($entity = NULL)
 {
     if ($entity) {
         $this->entity = $entity;
     } else {
         if ($this->getEntityType() == 'node') {
             // Node specific preparation.
             $this->entity = new stdClass();
             $this->entity->type = $this->getBundle();
             node_object_prepare($this->entity);
         } else {
             $this->entity = entity_create($this->getEntityType(), array('type' => $this->getBundle()));
         }
     }
 }
开发者ID:alnutile,项目名称:entity_decorator,代码行数:18,代码来源:EntityDecorator.php


示例10: hook_instagram_media_save

/**
 * Notifies of a newly saved instagram media item.
 *
 * @param $type  string
 *    The type of the instagram media (image, video)
 * @param $item
 *    The instagram media item object
 *   stdClass containing the instagram media item.
 * @see https://www.instagram.com/developer/endpoints/media/ for details about the contents of $item.
 */
function hook_instagram_media_save($type, $item)
{
    //
    // add a node for all new items
    $node = new stdClass();
    $node->type = 'instagram';
    $node->language = LANGUAGE_NONE;
    $node->uid = 1;
    $node->status = 1;
    node_object_prepare($node);
    // assign all fields
    $node->body[LANGUAGE_NONE][0]['value'] = $item->caption;
    // save node
    $node = node_submit($node);
    node_save($node);
}
开发者ID:PixelGarage,项目名称:hso2,代码行数:26,代码来源:instagram_social_feed.api.php


示例11: __construct

 /**
  * Default constructor for the node object. Do not call this class directly.
  * Create a separate class for each content type and use its constructor.
  *
  * @param int $nid
  *   Nid if an existing node is to be loaded.
  */
 public function __construct($nid = NULL)
 {
     $class = new \ReflectionClass(get_called_class());
     $type = Utils::makeSnakeCase($class->getShortName());
     if (!is_null($nid) && is_numeric($nid)) {
         $node = node_load($nid);
         if ($node->type == $type) {
             parent::__construct($node);
         }
     } else {
         global $user;
         $node = (object) array('title' => NULL, 'type' => $type, 'language' => LANGUAGE_NONE, 'is_new' => TRUE, 'name' => $user->name);
         node_object_prepare($node);
         parent::__construct($node);
     }
     $this->setInitialized(TRUE);
 }
开发者ID:vishalred,项目名称:redtest-core-pw,代码行数:24,代码来源:Node.php


示例12: _save_node

/**
 * node save
 */
function _save_node($param_array = NULL)
{
    global $user;
    $node = new stdClass();
    $node->type = $param_array['type'];
    $node->title = $param_array['title'];
    $node->language = LANGUAGE_NONE;
    // Or any language code if Locale module is enabled. More on this below *
    node_object_prepare($node);
    // Set some default values.
    $node->uid = $user->uid;
    $node->field_chassis_dspl_chassis['und'][0]['product_id'] = $param_array['product_pid'];
    // $node->field_card_dspl_card['und'][0]['product_id'] = $param_array['product_pid'];
    $node = node_submit($node);
    // Prepare node for a submit
    node_save($node);
    // After this call we'll get a nid
    $node_nid = $node->nid;
    drupal_set_message(t('Save node as ') . $node_nid);
    return $node->nid;
}
开发者ID:temptemp5678,项目名称:onequote2,代码行数:24,代码来源:batch_save_node.php


示例13: nodeCreate

 /**
  * {@inheritdoc}
  */
 public function nodeCreate($node)
 {
     // Set original if not set.
     if (!isset($node->original)) {
         $node->original = clone $node;
     }
     // Assign authorship if none exists and `author` is passed.
     if (!isset($node->uid) && !empty($node->author) && ($user = user_load_by_name($node->author))) {
         $node->uid = $user->uid;
     }
     // Convert properties to expected structure.
     $this->expandEntityProperties($node);
     // Attempt to decipher any fields that may be specified.
     $this->expandEntityFields('node', $node);
     // Set defaults that haven't already been set.
     $defaults = clone $node;
     node_object_prepare($defaults);
     $node = (object) array_merge((array) $defaults, (array) $node);
     node_save($node);
     return $node;
 }
开发者ID:acbramley,项目名称:DrupalDriver,代码行数:24,代码来源:Drupal7.php


示例14: createContentFromImage

/**
 * Funzione che consente di creare automaticamente un contenuto drupal con le immagini jpg caricate in temp_img
 * e i dati exif ricavati da esse.
 *
 * @param $lat
 * @param $lng
 * @param $fileName
 *
 */
function createContentFromImage($lat, $lng, $fileName)
{
    $node = new stdClass();
    // Create a new node object Or page, or whatever content type you like
    $node->type = "exif_data";
    // Set some default values
    node_object_prepare($node);
    $node->language = "en";
    $node->uid = 1;
    $coords = (object) array('lat' => $lat, 'lng' => $lng);
    $node->field_posizione['und'][0] = (array) $coords;
    //@ToDo here you have to substitute the path
    $file_path = "/var/www/.." . $fileName;
    $count_photo = count($file_path);
    for ($i = 0; $i < $count_photo; $i++) {
        if (getimagesize($file_path)) {
            $file_gallery = (object) array('uid' => 0, 'uri' => $file_path, 'filemime' => file_get_mimetype($file_path), 'status' => 1);
            //substitute "your_destination_folder" with a folder name
            try {
                file_copy($file_gallery, 'public://your_destination_folder');
                $node->field_image['und'][0] = (array) $file_gallery;
                echo "File correctly copied";
            } catch (Exception $e) {
                echo $e->getMessage();
            }
        }
    }
    //$node = node_submit($node); // Prepare node for saving
    if ($node = node_submit($node)) {
        // Prepare node for saving
        node_save($node);
        //Drupal node saving function call
        $status = "Content created correctly" . "";
    } else {
        $status = "Something went wrong during the node submitting";
    }
    echo $status;
}
开发者ID:marshall86,项目名称:Drupal-content-generator,代码行数:47,代码来源:contentGenerator.php


示例15: create

    private function create ( ReportEntity $entity ) {
        $node = new \stdClass();
        $node->type = self::NODE_TYPE;
        $node->language = LANGUAGE_NONE;
        node_object_prepare($node);

        $node->title = $entity->getName();
        $node->uid = $entity->getAuthor()->getId();

        $node->field_report_uuid[$node->language][0]['value'] = $entity->getUuid(); //Uuid::generate();

        $node->field_report_desc[$node->language][0]['value'] = $entity->getDescription();

        $node->field_report_datasource[$node->language][0]['value'] = $entity->getDatasource();

        $node->field_report_conf[$node->language][0]['value'] = $entity->getConfig()->toJson();

        $node->field_report_dataset_sysnames[$node->language] = array();
        foreach ( $entity->getDatasets() as $dataset ) {
            $node->field_report_dataset_sysnames[$node->language][] = array('value' => $dataset->name);
        }

        $node->field_report_custom_view[$node->language][0]['value'] = $entity->getCustomCode();

        $node->field_report_tags[$node->language] = array();
        foreach ( $entity->getTags() as $tag ) {
            $node->field_report_tags[$node->language][] = array('tid' => $tag->tid);
        }

        node_save($node);

        // update the entity object

        // created, updated, uuid, etc.

    }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:36,代码来源:ReportRepository.php


示例16: build_new_node

 private function build_new_node($CTname, $elem)
 {
     $node = new stdClass();
     $node->type = $CTname;
     node_object_prepare($node);
     $node->title = $CTname;
     $node->language = 'it';
     $node->uid = $elem['uid'];
     $body_text = '';
     $node->body[$node->language][0]['value'] = '';
     $node->body[$node->language][0]['summary'] = text_summary($body_text);
     $node->body[$node->language][0]['format'] = 'filtered_html';
     $path = 'content/programmatically_created_node_' . date('YmdHis');
     $node->path = array('alias' => $path);
     $node->title = 'pagamento cliente';
     /**
      * custom  
      */
     $node = $this->set_CT_data($node, $elem);
     /**/
     node_save($node);
     $result = $node->nid;
     return $result;
 }
开发者ID:remo-candeli,项目名称:remoc-test,代码行数:24,代码来源:pagamenti_cliente.php


示例17: getTestNode

 /**
  * Create and return test node.
  *
  * @return \stdClass
  *    Return node object.
  */
 protected function getTestNode()
 {
     $content_type = $this->getTestContentType();
     $node = new \stdClass();
     $node->title = self::randomName(8);
     $node->type = $content_type->name;
     node_object_prepare($node);
     node_save($node);
     $this->entities['node'][] = $node->nid;
     return $node;
 }
开发者ID:janoka,项目名称:platform-dev,代码行数:17,代码来源:TokenHandlerAbstractTest.php


示例18: inject_data

/**
 * Creating dummy content during the installation process.
 */
function inject_data()
{
    global $base_url;
    $tmp_base_url = variable_get("tmp_base_url");
    // Populate users fields of dummy users.
    $account = user_load(1);
    $account1 = user_load_by_name("user_administrator");
    $account2 = user_load_by_name("user_contributor");
    $account3 = user_load_by_name("user_editor");
    $account->field_firstname['und'][0]['value'] = 'John';
    $account->field_lastname['und'][0]['value'] = 'Doe';
    user_save($account);
    $account1->field_firstname['und'][0]['value'] = 'John';
    $account1->field_lastname['und'][0]['value'] = 'Smith';
    user_save($account1);
    $account2->field_firstname['und'][0]['value'] = 'John';
    $account2->field_lastname['und'][0]['value'] = 'Name';
    user_save($account2);
    $account3->field_firstname['und'][0]['value'] = 'John';
    $account3->field_lastname['und'][0]['value'] = 'Blake';
    user_save($account3);
    // Create content.
    $node = new stdClass();
    $node->type = 'page';
    node_object_prepare($node);
    $node->title = 'Welcome to your site !';
    $node->language = LANGUAGE_NONE;
    $node->path = array('alias' => 'content/welcome-your-site');
    $node->status = '1';
    $node->uid = '1';
    $node->promote = '0';
    $node->sticky = '0';
    $node->created = '1330594184';
    $node->comment = '1';
    $node->translate = '0';
    $node->revision = 1;
    $node->body[$node->language][0]['value'] = '<p>Notice:</p>
    <p>You have to login in order to perform any of the action described below &gt;&gt; ' . l(t('Login'), $tmp_base_url . '/user') . '</p>
    <p>&nbsp;</p>
    <p>To complete the configuration of your site, here are&nbsp;some additional&nbsp;steps :</p>
    <p>- to access the <strong>Feature set</strong> configuration page which helps you to choose the features you wish to install on your site &gt;&gt; ' . l(t('click here'), $tmp_base_url . '/admin/structure/feature-set') . '</p>
    <p>- to access the <strong>user creation</strong> page in order to add some users and to choose the role you wish to give them &gt;&gt; ' . l(t('click here'), $tmp_base_url . '/admin/people') . '</p>
    <p>&nbsp;</p>
    <p>Some information about&nbsp;roles&nbsp;:</p>
    <p>- admin user can do everything on the site, but will mainly be used to approve/refuse user account creation or community creation</p>
    <p>- community manager will act as admin in its community to approve/refuse membership requests and creation of contents inside the community</p>
    <p>Management will be done through the <strong>Workbench </strong>you can access thru this ' . l(t('link'), $tmp_base_url . '/admin/workbench') . '.</p>
    <p>For more information about the various functionalities,&nbsp;a contextual help exists and can be accessed&nbsp;thru the &quot;Help&quot; link.&nbsp;The help section depends on your localisation on the site and gives details about the page.</p>
    ';
    $node->body[$node->language][0]['summary'] = '';
    $node->body[$node->language][0]['format'] = 'full_html';
    $path = 'content/welcome-your-site';
    $node->path = array('alias' => $path);
    // Prepare node for saving.
    if ($node = node_submit($node)) {
        node_save($node);
        echo "Node saved!\n";
    }
    // Delete mails from the update manager module.
    variable_del("update_notify_emails");
    // Manually insert the password policy in database.
    // This process is temporary since the module password_policy.
    $exports = cce_basic_config_default_password_policy();
    db_delete('password_policy')->execute();
    db_insert('password_policy')->fields(array('name' => 'Example policy', 'config' => $exports['Example policy']->config))->execute();
}
开发者ID:janoka,项目名称:platform-dev,代码行数:69,代码来源:inject_data.php


示例19: save_item

function save_item($title, $body_text = false, $sidebar_text = false, $tids = array())
{
    return;
    $node = new stdClass();
    $node->type = 'sidebar_snippet';
    node_object_prepare($node);
    $node->title = $title;
    $node->language = LANGUAGE_NONE;
    $node->uid = 1;
    $node->status = 1;
    if ($body_text !== false) {
        $node->body[$node->language][0]['value'] = $body_text;
        $node->body[$node->language][0]['format'] = 'full_html';
    }
    if ($sidebar_text !== false) {
        $node->body[$node->language][0]['field_sidebar_body']['value'] = $sidebar_snippet;
        $node->body[$node->language][0]['field_sidebar_body']['format'] = 'full_html';
    }
    foreach ($tids as $k => $v) {
        $node->field_tags[$node->language][]['tid'] = $v;
    }
    // $path = 'content/programmatically_created_node_' . date('YmdHis');
    // $node->path = array('alias' => $path);
    node_save($node);
}
开发者ID:sodacrackers,项目名称:washyacht,代码行数:25,代码来源:wyc_drush_node.php


示例20: imAtAWithTheTitle

 /**
  * @When /^I create a "(?P<content_type>(?:[^"]|\\")*)" node with the title "(?P<title>(?:[^"]|\\")*)"$/
  */
 public function imAtAWithTheTitle($content_type, $title)
 {
     // Create Node.
     $node = new stdClass();
     $node->title = $title;
     $node->type = $content_type;
     node_object_prepare($node);
     node_save($node);
     // Go to node page.
     // Using vistPath() instead of visit() method since it adds base URL to relative path.
     $this->visitPath('node/' . $node->nid);
 }
开发者ID:CuBoulder,项目名称:cu-express-drops-7,代码行数:15,代码来源:ExpressContext.php



注:本文中的node_object_prepare函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP node_revision_load函数代码示例发布时间:2022-05-15
下一篇:
PHP node_merge函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap