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

PHP node_type_get_types函数代码示例

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

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



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

示例1: hook_admin_menu_map

/**
 * Provide expansion arguments for dynamic menu items, i.e. menu paths
 * containing one or more %placeholders.
 *
 * The map items must be keyed by the dynamic path to expand. Each map item may
 * have the following properties:
 *
 * - parent: The parent menu path to link the expanded items to.
 * - arguments: An array of argument sets that will be used in the
 *   expansion. Each set consists of an array of one or more placeholders with
 *   an array of possible expansions as value. Upon expansion, each argument
 *   is combined with every other argument from the set (ie., the cartesian
 *   product of all arguments is created). The expansion values may be empty,
 *   that is, you don't need to insert logic to skip map items for which no
 *   values exist, since admin menu will take care of that.
 * - hide: (optional) Used to hide another menu item, usually a superfluous
 *   "List" item.
 *
 * @see admin_menu.map.inc
 */
function hook_admin_menu_map()
{
    // Expand content types in Structure >> Content types.
    // The key denotes the dynamic path to expand to multiple menu items.
    $map['admin/structure/types/manage/%node_type'] = array('parent' => 'admin/structure/types', 'hide' => 'admin/structure/types/list', 'arguments' => array(array('%node_type' => array_keys(node_type_get_types()))));
    return $map;
}
开发者ID:nagwani,项目名称:debugging_example,代码行数:27,代码来源:admin_menu.api.php


示例2: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state)
 {
     $results = $_POST;
     $form['method'] = array('#type' => 'hidden', '#value' => $results['method']);
     if (!isset($results['reset'])) {
         $results['reset'] = 0;
     }
     $form['all'] = array('#type' => 'hidden', '#value' => $results['all']);
     if (isset($results['all'])) {
         // Only carry reset value through if delete all nodes is set
         $form['reset'] = array('#type' => 'hidden', '#value' => $results['reset']);
         $form['all_warning'] = array('#markup' => '<p>' . $this->t('All content in all content types will be deleted. Be sure to have a backup of any important data!') . '</p>');
         if (!empty($results['reset'])) {
             if ($results['all']) {
                 $form['all_reset'] = array('#markup' => '<p>' . $this->t('Node, revision and comment counts will be reset.') . '</p>');
             }
         }
     } elseif (isset($results['types'])) {
         if (is_array($results['types'])) {
             foreach ($results['types'] as $key_type => $type) {
                 /**
                  * @TODO, if we use the form array the value doesn't exist in the submit
                  */
                 $_SESSION['nodes_type'][$key_type] = $type;
                 $info = node_type_get_types('type', $type);
                 $info = $info[$type];
                 $form[$type . '_warning'] = array('#markup' => '<p>' . $this->t('All content in the %type content type will be deleted. Be sure to have a backup of any important data!', array('%type' => $info->get('name'))) . '</p>');
             }
         }
         if ($results['reset']) {
             $form['all_reset'] = array('#markup' => '<p>' . $this->t('Sorry, we can\'t reset the counters because you are not deleting all nodes.') . '</p>');
         }
     }
     return parent::buildForm($form, $form_state);
 }
开发者ID:blakefrederick,项目名称:sas-backend,代码行数:38,代码来源:DeleteContentConfirmForm.php


示例3: settingsForm

 /**
  * Generate a settings form for this handler.
  */
 public function settingsForm($field, $instance)
 {
     #    echo '<pre>';
     #    print_r($instance);
     #    echo '</pre>';
     #    die;
     $options = array();
     if (!empty($field['settings']['handler_settings']['target_bundles'])) {
         $target_bundles = $field['settings']['handler_settings']['target_bundles'];
     } else {
         // By default, entity reference assumes that all bundles are enabled.
         $target_bundles = array_keys(node_type_get_types());
     }
     foreach ($target_bundles as $content_type) {
         $options[$content_type] = t(node_type_get_name($content_type));
     }
     $default_options = array();
     if (isset($instance['settings']['behaviors']['node_links'])) {
         foreach ($instance['settings']['behaviors']['node_links']['content_types'] as $content_type) {
             if ($content_type) {
                 $default_options[] = $content_type;
             }
         }
     }
     $form['content_types'] = array('#type' => 'checkboxes', '#title' => t('Content Types'), '#options' => $options, '#default_value' => $default_options, '#description' => t('Select the content types that will have create links for this type.'));
     return $form;
 }
开发者ID:acquiau-2015,项目名称:acquiau-drizzle,代码行数:30,代码来源:PrepopulateCreateNodeLinksInstanceBehavior.class.php


示例4: prepare

 /**
  * Override Migration::prepare().
  *
  * Set the term parent for heirarchical terms
  *
  * @param $term
  * @param $row
  */
 public function prepare($term, $row)
 {
     // Handle og_vocab
     $vocab_name = $this->bundle;
     if (!($vocabulary = taxonomy_vocabulary_machine_name_load($vocab_name))) {
         // Create a new vocabulary
         $vocabulary = (object) array('name' => 'Meter categories for ' . $row->account_id, 'description' => 'Meter categories for ' . $row->account_id, 'machine_name' => $vocab_name);
         taxonomy_vocabulary_save($vocabulary);
     }
     // Create an OG-vocab and relate new vocabulary with OG.
     $account_id = $term->account_id['destid1'];
     $settings = array('cardinality' => 1, 'required' => TRUE);
     // Loop for all meter content-types and create og-vocabulary.
     $node_types = node_type_get_types();
     foreach ($node_types as $content_type) {
         if (strpos($content_type->type, '_meter') === FALSE) {
             // Not a meter type, skip.
             continue;
         }
         $og_vocab = og_vocab_create_og_vocab($vocabulary->vid, 'node', $content_type->type, OG_VOCAB_FIELD, $settings);
         $og_vocab->save();
     }
     og_vocab_relation_save($vocabulary->vid, 'node', $account_id);
     // Save vocabulary id.
     $term->vid = $vocabulary->vid;
     // Handle parent.
     $term->name = ucwords(trim($term->name));
     $parent = ucwords(trim($row->parent));
     $parent_term = taxonomy_get_term_by_name($parent, $vocab_name);
     $parent_term = reset($parent_term);
     if ($parent_term) {
         $term->parent = $parent_term->tid;
     }
 }
开发者ID:Gizra,项目名称:negawatt-server,代码行数:42,代码来源:NegawattMeterCategoryTermsBase.php


示例5: dxray_get_node_type

/**
 *  Получаем список NODE_TYPE
 * modules/node/node.module
 * @link https://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/hook_node_info/7 description param
 * @link https://www.drupal.org/node/1027630 info
 */
function dxray_get_node_type()
{
    $GML = new GraphML();
    $optN1 = $GML->setOptionsNode()->Fill_setColor('#ccffff')->Label_setFontSize('22')->getOptions();
    $aNtypes = node_type_get_types();
    foreach ($aNtypes as $oType) {
        // 1. Сначала создаем узел NODE_TYPE
        $data['attributes'] = array('Base: ' . $oType->base, 'Type: ' . $oType->type, 'Help: ' . PHP_EOL . $oType->help . PHP_EOL, 'Custom: ' . $oType->custom, 'Modified: ' . $oType->modified, 'Locked: ' . $oType->locked, 'Disabled: ' . $oType->disabled, 'Is new: ' . $oType->is_new, 'Has title: ' . $oType->has_title, 'Title label: ' . $oType->title_label, 'Module: ' . $oType->module);
        $options['NodeFill']['color'] = '#ccffff';
        $ID_bundle = $GML->addNode($oType->name, 'UMLClassNode', $optN1, $data);
        dxray_debug_stdout('Добавили bundle номер: ' . $ID_bundle);
        // 2. Получаем поля данного контента и строем зависимости
        $fields = field_info_instances('node', $oType->type);
        foreach ($fields as $field) {
            $finfo = field_info_field($field['field_name']);
            $data['attributes'] = array('Label: ' . $field['label'], 'Required: ' . $field['required'], 'Module: ' . $finfo['module'], 'Locked: ' . $finfo['locked'], 'Cardinality: ' . $finfo['cardinality'], 'Description: ' . $field['description']);
            $dataHTML['attributes'] = array('<html>', 'Label: ' . $field['label'] . '<br>', 'Required: ' . $field['required'] . '<br>', '<b>Module:</b> ' . $finfo['module'] . '<br>', 'Locked: ' . $finfo['locked'] . '<br>', 'Cardinality: ' . $finfo['cardinality'] . '<br>', 'Description: ' . $field['description'] . '<br>', '</html>');
            $ID_field = $GML->addNode($field['field_name'], 'UMLClassNode', null, $dataHTML);
            dxray_debug_stdout('Добавили field номер: ' . $ID_field);
            dxray_debug_stdout("{EDGE} SRC: {$ID_bundle} TARGET: {$ID_field} " . $ID_field);
            $GML->addEdge($ID_bundle, $ID_field);
        }
    }
    $file = DXRAY_OUTPATH . '/NodeType-' . date('d-m-Y_H-i-s') . '.graphml';
    $GML->createFullGraphML($file);
    $dbg = 0;
}
开发者ID:JKeySZR,项目名称:GraphML,代码行数:33,代码来源:drupal.php


示例6: describe

 /**
  * {@inheritdoc}
  */
 function describe($api)
 {
     // We will have a separate rule per node type on Admin > Structure > Crumbs.
     foreach (node_type_get_types() as $type_name => $type) {
         $api->addRule($type_name, $type->name);
     }
 }
开发者ID:marecar,项目名称:acadcms,代码行数:10,代码来源:ListOfNews.php


示例7: hook_field_extra_fields_alter

/**
 * Alter "pseudo-field" components on fieldable entities.
 *
 * @param $info
 *   The associative array of 'pseudo-field' components.
 *
 * @see hook_field_extra_fields()
 */
function hook_field_extra_fields_alter(&$info) {
  // Force node title to always be at the top of the list by default.
  foreach (node_type_get_types() as $bundle) {
    if (isset($info['node'][$bundle]['title'])) {
      $info['node'][$bundle]['title']['weight'] = -20;
    }
  }
}
开发者ID:richielokay,项目名称:drupal7,代码行数:16,代码来源:field.api.php


示例8: getContentTypes

 /**
  * Add the types to the form. If there are no eligible types to delete,
  * we don't need to render the form.
  */
 protected function getContentTypes()
 {
     foreach (node_type_get_types() as $type => $info) {
         if (array_key_exists($type, $this->count)) {
             $this->types[$type] = $info->get('name') . ' (' . $this->count[$type] . ')';
         }
     }
 }
开发者ID:blakefrederick,项目名称:sas-backend,代码行数:12,代码来源:DeleteContentForm.php


示例9: hook_permission_grid_info

/**
 * Declare this module's structured permissions.
 *
 * A set of structured permissions is defined as a list of objects and a list
 * of verbs. The permissions are created by combining these. For example, the
 * list of node types and the verbs (create, edit, delete) form a grid of
 * permissions for operations on all the node types.
 *
 * This hook may be placed in the file MODULE.permissions.inc.
 *
 * @return
 *  An array of data for object types that have multiple permissions associated
 *  with them. The array keys are object machine names, eg, 'node' (though note
 *  these need not be entities).
 *  Values are arrays with the following properties:
 *    - 'label': The human-readable label of the object type.
 *    - 'objects': An array of the different objects of this type that have
 *      their own permissions, for example, node types, which each provide
 *      permissions such as 'create foo node types'. These will form the rows 
 *      of the permissions grid. The keys are the substrings of the permission
 *      strings, and the values are human-readable labels.
 *    - 'verb_groups': An array of one or more verb groups. Each verb group
 *      defines a list of verbs and a pattern for the permissions using those
 *      verbs. The verb groups keys are arbitrary (but using the name of the
 *      providing module is a good idea for ease of alterability), and each
 *      array has the following properties:
 *      - 'verbs': An array of verbs. The keys are the 'machine names', that is,
 *        the strings that are replaced into the pattern. The values may be
 *        human-readable labels. Note that verb machine names must be unique
 *        across all the verb groups for the object type.
 *      - 'pattern': The pattern of the permissions machine name, with the
 *        following replacements:
 *        - '%verb': The verb of the permission. This takes all the keys in the
 *          verbs array in this verb group.
 *        - '%object': The object of the permission. This takes all the keys in
 *          the objects array.
 *      - 'object_process_callback' (optional) A function to process the object
 *        name before replacing it into the pattern. (This is just a hack for
 *        taxonomy to work.) 
 */
function hook_permission_grid_info()
{
    $return = array('node' => array('label' => t('Content type'), 'objects' => array(), 'verb_groups' => array('node' => array('pattern' => '%verb %object content', 'verbs' => array('create' => t('Create'), 'edit own' => t('Edit own'), 'edit any' => t('Edit any'), 'delete own' => t('Delete own'), 'delete any' => t('Delete any'))))));
    $node_types = node_type_get_types();
    $configured_types = node_permissions_get_configured_types();
    foreach ($configured_types as $type) {
        $return['node']['objects'][$type] = $node_types[$type]->name;
    }
    return $return;
}
开发者ID:chaunceyt,项目名称:website,代码行数:50,代码来源:permission_grid.api.php


示例10: getContentTypes

 function getContentTypes()
 {
     $types = array();
     $node = node_type_get_types();
     $node_types = new NodeTypes();
     foreach ($node as $key => $value) {
         $node_types->loadNode($value);
         $types[$key] = $node_types->getName();
     }
     return $types;
 }
开发者ID:mehulmakwana97,项目名称:Drupal-Module,代码行数:11,代码来源:UploadCSVForm.php


示例11: eldir_preprocess_node

/**
 * Preprocessor for theme_node().
 */
function eldir_preprocess_node(&$variables, $hook)
{
    if (!empty($variables['node'])) {
        // Add a node type label on node pages to help users.
        $types = node_type_get_types();
        $type = $variables['node']->type;
        if (!empty($types[$type])) {
            $variables['title'] = "<span class='label'>{$types[$type]->name}</span>" . $variables['title'];
        }
    }
}
开发者ID:srijanlabs,项目名称:assessment,代码行数:14,代码来源:template.php


示例12: ContentTypeExists

 /**
  * @Given /^"([^"]*)" Content Type exists$/
  */
 public function ContentTypeExists($type)
 {
     $types = node_type_get_types();
     foreach ($types as $contentType) {
         if ($contentType->name == $type) {
             $this->contentType = $contentType;
             break;
         }
     }
     assertNotEmpty($this->contentType);
 }
开发者ID:promet,项目名称:drupal-behat-extension,代码行数:14,代码来源:ContentTypeContext.php


示例13: buildForm

 /** 
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state)
 {
     $config = $this->config('questions.settings');
     //echo "<pre>";
     // print_r(node_type_get_types());
     // exit;
     foreach (node_type_get_types() as $key => $value) {
         $options[$key] = $value->label();
     }
     $form['qus_content_type'] = array('#type' => 'select', '#default_value' => array($config->get('content_type')), '#options' => $options, '#title' => $this->t('Select content type'));
     return parent::buildForm($form, $form_state);
 }
开发者ID:National-Control-Devices,项目名称:questions-listing-page-module,代码行数:15,代码来源:questionsSettingsForm.php


示例14: getIdByArguments

 /**
  * @param string $title
  *   Inaccurate title of a node.
  * @param string $contentType
  *   Content type. Could be a title of content type.
  *
  * @return int
  *
  * @throws \InvalidArgumentException
  */
 public function getIdByArguments($title, $contentType = '')
 {
     $nid = new FetchField('node', 'nid');
     $nid->condition('title', "{$title}%", 'like');
     // Try to recognize node type by its title if content type specified and does not exist.
     if ('' !== $contentType && !isset(node_type_get_types()[$contentType])) {
         $contentType = (new FetchField('node_type', 'type'))->condition('name', $contentType)->execute();
         if ('' === $contentType) {
             throw new \InvalidArgumentException('Content type with such name does not exist!');
         }
         $nid->condition('type', $contentType);
     }
     return $nid->execute();
 }
开发者ID:BR0kEN-,项目名称:TqExtension,代码行数:24,代码来源:RawNodeContext.php


示例15: setUp

 protected function setUp()
 {
     parent::setUp();
     // Create an article content type only if it does not yet exist, so that
     // child classes may specify the standard profile.
     $types = node_type_get_types();
     if (empty($types['article'])) {
         $this->drupalCreateContentType(array('type' => 'article', 'name' => t('Article')));
     }
     // Create two test users.
     $this->admin_user = $this->drupalCreateUser(array('administer content types', 'administer comments', 'administer comment types', 'administer comment fields', 'administer comment display', 'skip comment approval', 'post comments', 'access comments', 'access content'));
     $this->web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'create article content', 'edit own comments', 'skip comment approval', 'access content'));
     // Create comment field on article.
     $this->container->get('comment.manager')->addDefaultField('node', 'article');
     // Create a test node authored by the web user.
     $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'uid' => $this->web_user->id()));
 }
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:17,代码来源:CommentTestBase.php


示例16: action_list

function action_list()
{
    $header = array(t('Content Type'), t('Paths'), t('Operations'));
    $rows = array();
    $content_types = node_type_get_types();
    foreach (publisher_purge_get_all_content_type_paths() as $content_type => $paths) {
        $content_type_info = $content_types[$content_type];
        $row = array();
        $row[] = $content_type_info->name;
        if (empty($paths)) {
            $row[] = '<em>No Paths</em>';
        } else {
            $row[] = theme('item_list', array('items' => array_map('check_plain', $paths)));
        }
        $row[] = theme('links', array('links' => array(array('title' => 'Edit Paths', 'href' => 'admin/config/publisher/purge/' . $content_type)), 'attributes' => array('class' => array('links', 'inline'))));
        $rows[] = $row;
    }
    return theme('table', array('rows' => $rows, 'header' => $header));
}
开发者ID:sammarks,项目名称:publisher,代码行数:19,代码来源:admin.php


示例17: buildForm

 /**
  * {@inheritdoc}
  *
  * @todo, displays last backup timestamp
  */
 public function buildForm(array $form, FormStateInterface $form_state)
 {
     $options = array();
     // Get list of content type.
     $types = node_type_get_types();
     ksort($types);
     foreach ($types as $key => $values) {
         $query = \Drupal::entityQuery('node')->condition('type', $key)->count();
         $count = $query->execute();
         if ($count > 0) {
             $options[$key] = $values->get('name') . " ({$count})";
         }
     }
     if (empty($options)) {
         $form['default_msg'] = array('#type' => 'item', '#markup' => t('Node not available.'));
     } else {
         $form['types'] = array('#type' => 'checkboxes', '#title' => $this->t('Content types for deletion'), '#options' => $options, '#description' => t('All nodes of these types will be deleted using the batch API.'));
         $form['actions']['#type'] = 'actions';
         $form['submit'] = array('#type' => 'submit', '#value' => $this->t('Delete'), '#button_type' => 'primary');
     }
     return $form;
 }
开发者ID:rahulseth,项目名称:bulkdelete,代码行数:27,代码来源:BulkDeleteForm.php


示例18: sociale_platforme_form_system_theme_settings_alter

/**
 * Implements hook_form_system_theme_settings_alter().
 */
function sociale_platforme_form_system_theme_settings_alter(&$form, $form_state)
{
    // Hide advanced theme settings
    // $form["theme_settings"]['#access'] = FALSE;
    // $form["alpha_settings"]['#access'] = FALSE;.
    // The following CT should always be active.
    $types_default = array("group", "post", "notice");
    // Content Types.
    $types = node_type_get_types();
    $types_list = array();
    foreach ($types as $key => $val) {
        if (!in_array($key, $types_default)) {
            $types_list[$key] = $val->name;
        }
    }
    // Settings Form.
    $form['general'] = array('#title' => t('Site information'), '#type' => 'fieldset', '#collapsible' => TRUE);
    $form['general']['site_name'] = array('#type' => 'textfield', '#title' => t('Site name'), '#required' => TRUE, '#default_value' => variable_get('site_name'));
    $form['general']['site_mail'] = array('#type' => 'textfield', '#title' => t('Email address'), '#description' => 'Fra-adressen i automatiske beskeder som sendes ved oprettelse af brugere samt udsendelse af nye adgangskoder og andre beskeder. (Brug en adresse på sitets domæne for at undgå at beskeder fra adressen bliver markeret som spam.)', '#required' => TRUE, '#default_value' => variable_get('site_mail'));
    $form['types'] = array('#title' => 'Indholdstyper', '#type' => 'fieldset');
    $form['types']['sp_content_types'] = array('#type' => 'checkboxes', '#title' => t('Content types'), '#options' => $types_list, '#default_value' => theme_get_setting('sp_content_types'), '#description' => 'Vælg hvilke indholdstyper der skal være aktive på websitet.');
    $form['#process'][] = 'sociale_platforme_make_collapsible';
    $form['#submit'][] = 'sociale_platforme_settings_form_submit';
}
开发者ID:rimi-itk,项目名称:sociale_platforme,代码行数:27,代码来源:theme-settings.php


示例19: ec_resp_form_alter

/**
 * Implements hook_form_alter().
 */
function ec_resp_form_alter(&$form, &$form_state, $form_id)
{
    switch ($form_id) {
        case 'nexteuropa_europa_search_search_form':
            if (theme_get_setting('enable_interinstitutional_theme')) {
                $form['search_input_group']['europa_search_submit']['#type'] = 'image_button';
                $form['search_input_group']['europa_search_submit']['#src'] = drupal_get_path('theme', 'ec_resp') . '/images/search-button.gif';
                $form['search_input_group']['europa_search_submit']['#attributes']['class'] = array_merge($form['search_input_group']['europa_search_submit']['#attributes']['class'], array('btn', 'btn-default'));
                $form['search_input_group']['europa_search_submit']['#attributes']['alt'] = t('Search');
            }
            break;
        case 'search_block_form':
            $form['search_block_form']['#attributes']['placeholder'][] = t('Search');
            $form['actions']['submit']['#type'] = 'image_button';
            if (theme_get_setting('enable_interinstitutional_theme')) {
                $form['actions']['submit']['#src'] = drupal_get_path('theme', 'ec_resp') . '/images/search-button.gif';
            } else {
                $form['actions']['submit']['#src'] = drupal_get_path('theme', 'ec_resp') . '/images/search-button.png';
            }
            $form['actions']['submit']['#attributes']['class'][] = 'btn btn-default btn-small';
            $form['actions']['submit']['#attributes']['alt'] = t('Search');
            break;
        case 'apachesolr_search_custom_page_search_form':
        case 'search_form':
            $form['basic']['#attributes']['class'][] = 'input-group';
            $form['basic']['keys']['#title'] = '';
            $form['basic']['keys']['#attributes']['placeholder'][] = t('Search');
            $form['basic']['submit']['#type'] = 'image_button';
            $form['basic']['submit']['#src'] = drupal_get_path('theme', 'ec_resp') . '/images/search-button.png';
            $form['basic']['submit']['#attributes']['class'][] = 'btn btn-default btn-small';
            break;
        case 'add_media_form':
            $form['submit']['#attributes']['class'][] = 'btn btn-default';
            break;
        case 'comment_admin_overview':
            $form['options']['submit']['#attributes']['class'][] = 'btn-small';
            $form['comments']['#prefix'] = '<div class="table-responsive">';
            $form['comments']['#suffix'] = '</div>';
            break;
        case 'views_exposed_form':
            if (isset($form['submit'])) {
                $form['submit']['#attributes']['class'][] = 'btn-small';
            }
            break;
        case 'feature_set_admin_form':
            if (isset($form['submit']) && $form['submit']['#type'] == "submit") {
                $form['submit']['#value'] = t('Validate');
                $form['submit']['#attributes']['class'][] = 'btn';
                $form['submit']['#attributes']['class'][] = 'btn-lg';
                $form['submit']['#attributes']['class'][] = 'btn-success';
            }
            break;
        default:
            break;
    }
    $content_types = node_type_get_types();
    foreach ($content_types as $content_type) {
        if ($form_id === $content_type->type . "_node_form") {
            $form['actions']['submit']['#attributes']['class'][] = 'btn btn-default';
            $form['actions']['preview']['#attributes']['class'][] = 'btn btn-default';
        }
    }
    // Hide format field.
    if (!user_access('administer nodes')) {
        $form['#after_build'][] = 'ec_resp_after_build';
    }
}
开发者ID:ec-europa,项目名称:platform-dev,代码行数:70,代码来源:template.php


示例20: expandEntityProperties

 /**
  * Given an entity object, expand any property fields to the expected structure.
  */
 protected function expandEntityProperties(\stdClass $entity)
 {
     // The created field may come in as a readable date, rather than a timestamp.
     if (isset($entity->created) && !is_numeric($entity->created)) {
         $entity->created = strtotime($entity->created);
     }
     // Map human-readable node types to machine node types.
     $types = \node_type_get_types();
     foreach ($types as $type) {
         if ($entity->type == $type->name) {
             $entity->type = $type->type;
             continue;
         }
     }
 }
开发者ID:ian-yin,项目名称:drupalextension,代码行数:18,代码来源:Drupal7.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP node_type_save函数代码示例发布时间:2022-05-15
下一篇:
PHP node_type_get_type函数代码示例发布时间: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