forked from ruchikumari94/iitbacademic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iitbacademic.install
81 lines (67 loc) · 4.16 KB
/
iitbacademic.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
use \Drupal\node\Entity\Node;
use Drupal\taxonomy\Entity\Term;
/**
* @file
* Install, update and uninstall hooks for the Demo install profile.
*/
/**
* Implements hook_install().
*
* Perform actions to set up the site for this profile.
*
* @see system_install()
*/
function iitbacademic_install() {
// First, do everything that is done in the standard profile.
include_once DRUPAL_ROOT . '/core/profiles/standard/standard.install';
standard_install();
//\Drupal::service('theme_handler')->setDefault('academix');
// Enable the admin theme.
//\Drupal::configFactory()->getEditable('node.settings')->set('seven', TRUE)->save(TRUE);
// Set it as the admin theme
//\Drupal::service('config.factory')->getEditable('system.theme')->set('admin', 'seven')->save();
// Add code here to make nodes, terms, etc.
// Set front page to "node".
//\Drupal::configFactory()->getEditable('system.site')->set('page.front', '/home')->save(TRUE);
// Assign user 1 the "developer" role.
//$user = User::load(1);
//$user->roles[] = 'administrator';
//$user->save();
// Enable the admin theme.
//\Drupal::configFactory()->getEditable('node.settings')->set('use_admin_theme', TRUE)->save(TRUE);
// Creating users with this role.
//$user_add = User::create();
//$user_add->setUsername('Tom');
//$user_add->setEmail('[email protected]');
//$user_add->setPassword(user_password());
//$user_add->enforceIsNew();
//$user_add->activate();
//$user_add->roles[] = 'developer';
//$user_save = $user_add->save();
//$user_add = User::create();
//$user_add->setUsername('Harry');
//$user_add->setEmail('[email protected]');
//$user_add->setPassword(user_password());
//$user_add->enforceIsNew();
//$user_add->activate();
//$user_add->roles[] = 'developer';
//$user_save = $user_add->save();
$node = Node::create([
'type' => 'page',
'title' => 'About Us',
'body' => array(
'value' =>"Established in 1958, the second of its kind, IIT Bombay was the first to be set up with foreign assistance. The funds from UNESCO came as Roubles from the then Soviet Union. In 1961 Parliament decreed the IITs as ‘Institutes of National Importance'. Since then, IITB has grown from strength to strength to emerge as one of the top technical universities in the world.
The institute is recognised worldwide as a leader in the field of engineering education and research. Reputed for the outstanding calibre of students graduating from its undergraduate and postgraduate programmes, the institute attracts the best students from the country for its bachelor's, master's and doctoral programmes. Research and academic programmes at IIT Bombay are driven by an outstanding faculty, many of whom are reputed for their research contributions internationally.
IIT Bombay also builds links with peer universities and institutes, both at the national and the international levels, to enhance research and enrich its educational programmes. The alumni have distinguished themselves through their achievements in and contributions to industry, academics, research, business, government and social domains. The institute continues to work closely with the alumni to enhance its activities through interactions in academic and research programmes as well as to mobilise financial support.
Over the years, the institute has created a niche for its innovative short-term courses through continuing education and distance education programmes. Members of the faculty of the institute have won many prestigious awards and recognitions, including the Shanti Swaroop Bhatnagar and Padma awards.
Located in Powai, one of the northern suburbs of Mumbai, the residents of the institute reap the advantage of being in the busy financial capital of India, while at the same time enjoying the serenity of a campus known for its natural beauty. A fully residential institute, all its students are accommodated in its 15 hostels with in-house dining; the campus also provides excellent amenities for sports and other recreational facilities.",
'format' => 'full_html',
),
]);
$node->save();
$term =Term::create([
'name' => 'term 1',
'vid' => 'department',
])->save();
}