当前位置: 首页>>代码示例>>PHP>>正文


PHP Section::setLabel方法代码示例

本文整理汇总了PHP中Section::setLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP Section::setLabel方法的具体用法?PHP Section::setLabel怎么用?PHP Section::setLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Section的用法示例。


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

示例1: add

 public static function add($name, $description = "", $grantAdmin = true)
 {
     $sectionManager = new Section();
     if ($sectionManager->rowCount(array('label' => $name)) == 0) {
         $sectionManager->setLabel($name);
         $sectionManager->setDescription($description);
         $sectionManager->save();
         if ($grantAdmin) {
             $right = new Right();
             $right = $right->load(array('section' => $sectionManager->getLabel(), 'rank' => 1));
             $right = !$right ? new Right() : $right;
             $right->setSection($sectionManager->getId());
             $right->setCreate(1);
             $right->setRead(1);
             $right->setUpdate(1);
             $right->setDelete(1);
             $right->setRank(1);
             $right->save();
         }
     }
 }
开发者ID:kofeve,项目名称:yana-server,代码行数:21,代码来源:Section.class.php

示例2: KodiCmd

<?php

require_once 'KodiCmd.class.php';
$table = new KodiCmd();
$table->create();
$s1 = new Section();
$s1->setLabel('kodi');
$s1->save();
$r1 = new Right();
$r1->setSection($s1->getId());
$r1->setRead('1');
$r1->setDelete('1');
$r1->setCreate('1');
$r1->setUpdate('1');
$r1->setRank('1');
$r1->save();
$conf = new Configuration();
$conf->put('plugin_kodiCmd_api_url_kodi', 'http://192.168.1.107:85/jsonrpc');
$conf->put('plugin_kodiCmd_api_timeout_kodi', 5);
$conf->put('plugin_kodiCmd_api_recognition_status', '');
$ro = new Room();
$ro->setName('KODI');
$ro->setDescription('De la bonne zic, un bon p\'tit film....');
$ro->save();
$roomManager = new Room();
$rooms = $roomManager->populate();
foreach ($rooms as $room) {
    if ($room->getName() == "KODI") {
        $kodiRoomId = $room->getId();
    }
}
开发者ID:eflye,项目名称:yana-plugins,代码行数:31,代码来源:install.php

示例3: loadEntities

 protected function loadEntities($simulator, $datasources)
 {
     foreach ($datasources->DataSource as $datasource) {
         $datasourceObj = new DataSource($this, (int) $datasource['id'], (string) $datasource['name'], (string) $datasource['type']);
         $datasourceObj->setUri((string) $datasource['uri']);
         $datasourceObj->setMethod((string) $datasource['method']);
         $datasourceObj->setDatabase((int) $datasource['database']);
         $datasourceObj->setDescription((string) $datasource->Description);
         foreach ($datasource->Namespace as $namespace) {
             $datasourceObj->addNamespace((string) $namespace['prefix'], (string) $namespace['uri']);
         }
         $this->datasources[] = $datasourceObj;
     }
     if ($datasources->Databases) {
         foreach ($datasources->Databases->Database as $database) {
             $databaseObj = new Database($this, (int) $database['id'], (string) $database['type'], (string) $database['name']);
             $databaseObj->setLabel((string) $database['label']);
             $databaseObj->setHost((string) $database['host']);
             $databaseObj->setPort((int) $database['port']);
             $databaseObj->setUser((string) $database['user']);
             if ((string) $database['password'] != '') {
                 $databaseObj->setPassword((string) $database['password']);
             } elseif ((string) $database['user'] != '') {
                 try {
                     $user = $this->controller->get('kernel')->getContainer()->getParameter('database_user');
                     if ((string) $database['user'] == $user) {
                         $databaseObj->setPassword($this->controller->get('kernel')->getContainer()->getParameter('database_password'));
                     }
                 } catch (\Exception $e) {
                 }
             }
             $this->databases[] = $databaseObj;
         }
     }
     $this->setName((string) $simulator["name"]);
     $this->setLabel((string) $simulator["label"]);
     $this->setDefaultView((string) $simulator["defaultView"]);
     $this->setReferer((string) $simulator["referer"]);
     $this->setDynamic((string) $simulator['dynamic'] == '1');
     $this->setMemo((string) $simulator['memo'] == '1');
     $this->setDescription((string) $simulator->Description);
     $this->setRelatedInformations($simulator->RelatedInformations);
     $this->setDateFormat((string) $simulator->DataSet['dateFormat']);
     $this->setDecimalPoint((string) $simulator->DataSet['decimalPoint']);
     $this->setMoneySymbol((string) $simulator->DataSet['moneySymbol']);
     $this->setSymbolPosition((string) $simulator->DataSet['symbolPosition']);
     if ($simulator->DataSet) {
         foreach ($simulator->DataSet->children() as $child) {
             if ($child->getName() == "DataGroup") {
                 $datagroup = $child;
                 $dataGroupObj = new DataGroup($this, (int) $datagroup['id'], (string) $datagroup['name']);
                 $dataGroupObj->setLabel((string) $datagroup['label']);
                 $dataGroupObj->setDescription((string) $datagroup->Description);
                 foreach ($datagroup->Data as $data) {
                     $dataGroupObj->addData($this->loadData($data));
                 }
                 $this->datas[] = $dataGroupObj;
             } elseif ($child->getName() == "Data") {
                 $this->datas[] = $this->loadData($child);
             }
         }
     }
     if ($simulator->Profiles) {
         $this->profiles = new Profiles($this);
         $this->profiles->setLabel((string) $simulator->Profiles['label']);
         foreach ($simulator->Profiles->Profile as $profile) {
             $profileObj = new Profile((int) $profile['id'], (string) $profile['name']);
             $profileObj->setLabel((string) $profile['label']);
             $profileObj->setDescription((string) $profile->Description);
             foreach ($profile->Data as $data) {
                 $profileObj->addData((int) $data['id'], (string) $data['default']);
             }
             $this->profiles->addProfile($profileObj);
         }
     }
     if ($simulator->Steps) {
         $step0 = false;
         foreach ($simulator->Steps->Step as $step) {
             $stepObj = new Step($this, (int) $step['id'], (string) $step['name'], (string) $step['label'], (string) $step['template']);
             if ($stepObj->getId() == 0) {
                 $step0 = true;
             }
             $stepObj->setOutput((string) $step['output']);
             $stepObj->setDescription((string) $step->Description);
             $stepObj->setDynamic((string) $step['dynamic'] == '1');
             foreach ($step->Panels->Panel as $panel) {
                 $panelObj = new Panel($stepObj, (int) $panel['id']);
                 $panelObj->setName((string) $panel['name']);
                 $panelObj->setLabel((string) $panel['label']);
                 foreach ($panel->children() as $block) {
                     if ($block->getName() == "FieldSet") {
                         $fieldset = $block;
                         $fieldsetObj = new FieldSet($panelObj, (int) $fieldset['id']);
                         $fieldsetObj->setLegend((string) $fieldset->Legend);
                         if ((string) $fieldset['disposition'] != "") {
                             $fieldsetObj->setDisposition((string) $fieldset['disposition']);
                         }
                         if ((string) $fieldset['display'] != "") {
                             $fieldsetObj->setDisplay((string) $fieldset['display']);
                         }
//.........这里部分代码省略.........
开发者ID:eureka2,项目名称:g6k,代码行数:101,代码来源:Simulator.php

示例4: Dashboard

<?php

global $myUser;
require_once 'Dashboard.class.php';
require_once 'Widget.class.php';
$entity = new Dashboard();
$entity->create();
$entity->user = $myUser->getId();
$entity->label = "Général";
$entity->default = 1;
$entity->save();
$dashboard = $entity->id;
$entity = new Widget();
$entity->create();
$s1 = new Section();
$s1->setLabel('dashboard');
$s1->save();
$r1 = new Right();
$r1->setSection($s1->getId());
$r1->setRead('1');
$r1->setDelete('1');
$r1->setCreate('1');
$r1->setUpdate('1');
$r1->setRank('1');
$r1->save();
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("id", "model", "data", "cell", "column", "minified","dashboard") VALUES (1,	\'dash_profil\',	\'null\',	\'0\',	\'0\',	\'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("id", "model", "data", "cell", "column", "minified","dashboard") VALUES (2,	\'dash_monitoring_ram\',	\'null\',	\'0\',	\'1\',	\'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("id", "model", "data", "cell", "column", "minified","dashboard") VALUES (3,	\'dash_monitoring_system\',	\'null\',	\'0\',	\'2\',	\'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("id", "model", "data", "cell", "column", "minified","dashboard") VALUES (4,	\'dash_monitoring_network\',	\'null\',	\'0\',	\'2\',	\'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("id", "model", "data", "cell", "column", "minified","dashboard") VALUES (5,	\'dash_monitoring_hdd\',	\'null\',	\'3\',	\'1\',	\'\',\'' . $dashboard . '\');');
$entity->customQuery('INSERT INTO "yana_plugin_dashboard" ("id", "model", "data", "cell", "column", "minified","dashboard") VALUES (6,	\'dash_monitoring_disk\',	\'null\',	\'0\',	\'1\',	\'\',\'' . $dashboard . '\');');
开发者ID:thib3113,项目名称:yana-server,代码行数:31,代码来源:install.php

示例5: Rank

 $configuration->put('COOKIE_NAME', 'yana');
 $configuration->put('COOKIE_LIFETIME', '7');
 $configuration->put('VOCAL_ENTITY_NAME', 'YANA');
 $configuration->put('PROGRAM_VERSION', '3.0.6');
 $configuration->put('HOME_PAGE', 'index.php');
 $configuration->put('VOCAL_SENSITIVITY', '0.0');
 //Création du rang admin
 $rank = new Rank();
 $rank->setLabel('admin');
 $rank->save();
 //Déclaration des sections du programme
 $sections = array('event', 'vocal', 'user', 'plugin', 'configuration', 'admin');
 //Création des sections déclarées et attribution de tous les droits sur toutes ces sections pour l'admin
 foreach ($sections as $sectionName) {
     $s = new Section();
     $s->setLabel($sectionName);
     $s->save();
     $r = new Right();
     $r->setSection($s->getId());
     $r->setRead('1');
     $r->setDelete('1');
     $r->setCreate('1');
     $r->setUpdate('1');
     $r->setRank($rank->getId());
     $r->save();
 }
 $personalities = array('John Travolta', 'Jeff Buckley', 'Tom Cruise', 'John Lennon', 'Emmet Brown', 'Geo trouvetou', 'Luke Skywalker', 'Mac Gyver', 'Marty McFly');
 $im = $personalities[rand(0, count($personalities) - 1)];
 list($fn, $n) = explode(' ', $im);
 //Creation du premier compte et assignation en admin
 $user->setMail($_POST['email']);
开发者ID:thib3113,项目名称:yana-server,代码行数:31,代码来源:install.php

示例6: Sensor

/* 
	Le code contenu dans cette page ne sera éxecuté qu'à l'activation du plugin 
	Vous pouvez donc l'utiliser pour créer des tables SQLite, des dossiers, ou executer une action
	qui ne doit se lancer qu'à l'installation ex :
*/
require_once 'Sensor.class.php';
$table = new Sensor();
$table->create();
require_once 'SensorType.class.php';
$table2 = new SensorType();
$table2->create();
$s1 = new Section();
$s1->setLabel('sensor');
$s1->save();
$s2 = new Section();
$s2->setLabel('sensortypes');
$s2->save();
$r1 = new Right();
$r1->setSection($s1->getId());
$r1->setRead('1');
$r1->setDelete('1');
$r1->setCreate('1');
$r1->setUpdate('1');
$r1->setRank('1');
$r1->save();
$r2 = new Right();
$r2->setSection($s2->getId());
$r2->setRead('1');
$r2->setDelete('1');
$r2->setCreate('1');
$r2->setUpdate('1');
开发者ID:sachaw0lf,项目名称:yana-sensor-plugin,代码行数:31,代码来源:install.php


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