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

PHP get_Class函数代码示例

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

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



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

示例1: __construct

 /**
  * @param $post WP_Post
  * @throws ErrorException
  */
 function __construct($post)
 {
     if (gettype($post) != 'object' or get_class($post) != 'WP_Post') {
         td_util::error(__FILE__, 'td_module: ' . get_Class($this) . '($post): $post is not WP_Post');
     }
     //this filter is used by td_unique_posts.php - to add unique posts to the array for the datasource
     apply_filters("td_wp_booster_module_constructor", $this, $post);
     $this->post = $post;
     // by default the WordPress title is not escaped on twenty fifteen
     $this->title = get_the_title($post->ID);
     $this->title_attribute = esc_attr(strip_tags($this->title));
     $this->href = esc_url(get_permalink($post->ID));
     if (has_post_thumbnail($this->post->ID)) {
         $tmp_get_post_thumbnail_id = get_post_thumbnail_id($this->post->ID);
         if (!empty($tmp_get_post_thumbnail_id)) {
             // if we have a wrong id, leave the post_thumb_id NULL
             $this->post_thumb_id = $tmp_get_post_thumbnail_id;
         }
     }
     //get the review metadata
     //$this->td_review = get_post_meta($this->post->ID, 'td_review', true); @todo $this->td_review variable name must be replaced and the 'get_quotes_on_blocks', 'get_category' methods also
     $this->td_review = get_post_meta($this->post->ID, 'td_post_theme_settings', true);
     if (!empty($this->td_review['has_review']) and (!empty($this->td_review['p_review_stars']) or !empty($this->td_review['p_review_percents']) or !empty($this->td_review['p_review_points']))) {
         $this->is_review = true;
     }
 }
开发者ID:rinodung,项目名称:newspaper-wordpress,代码行数:30,代码来源:td_module.php


示例2: factory

 /**
  * Create the user-Proxy according to the given User-Object
  *
  * @return UserInterface
  * @throws \UnexpectedValueException
  */
 public function factory($userObject)
 {
     if ($userObject instanceof \Hybridauth\Entity\Profile) {
         $userProxy = new HybridAuthUserWrapper();
         $userProxy->setUser($userObject);
         return $userProxy;
     }
     throw new \UnexpectedValueException(sprintf('The given Object could not be found. Found "%s" instead', get_Class($userObject)));
 }
开发者ID:alexandremnarciso,项目名称:HybridAuth,代码行数:15,代码来源:UserWrapperFactory.php


示例3: factory

 /**
  * Create the user-Proxy according to the given User-Object
  *
  * @return UserInterface
  * @throws \UnexpectedValueException
  */
 public function factory($userObject)
 {
     switch (get_class($userObject)) {
         case 'Hybridauth\\Entity\\Profile':
             $userProxy = new HybridAuthUserWrapper();
             $userProxy->setUser($userObject);
             return $userProxy;
             break;
         default:
             throw new \UnexpectedValueException(sprintf('The given Object could not be found. Found "%s" instead', get_Class($userObject)));
     }
     throw new \UnexpectedValueException('The given Object could not be found');
     return false;
 }
开发者ID:pixelpin,项目名称:heiglhybridauth,代码行数:20,代码来源:UserWrapperFactory.php


示例4: serialise

 public function serialise($data)
 {
     if (is_object($data)) {
         $parent = $this->writeParentTag(get_Class($data), $this->dom);
         $this->serialiseObject($parent, $data);
         return $this->dom;
     } else {
         if (is_array($data)) {
             $parent = $this->writeParentTag('array', $this->dom);
             $this->serialiseArray($parent, $data);
             return $this->dom;
         }
     }
     exit("Serialise Requires data to be type object or string");
 }
开发者ID:TheProjecter,项目名称:scratch-framework,代码行数:15,代码来源:serialiser.php


示例5: __construct

 /**
  * @param $post WP_Post
  * @throws ErrorException
  */
 function __construct($post)
 {
     if (gettype($post) != 'object' or get_class($post) != 'WP_Post') {
         throw new ErrorException('td_module: ' . get_Class($this) . '($post): $post is not WP_Post');
     }
     //this filter is used by td_unique_posts.php - to add unique posts to the array for the datasource
     apply_filters("td_wp_booster_module_constructor", $this, $post);
     $this->post = $post;
     // by default the WordPress title is not escaped on twenty fifteen
     $this->title = get_the_title($post->ID);
     $this->title_attribute = esc_attr(strip_tags($this->title));
     $this->href = esc_url(get_permalink($post->ID));
     if (has_post_thumbnail($this->post->ID)) {
         $this->post_has_thumb = true;
     }
     //get the review metadata
     //$this->td_review = get_post_meta($this->post->ID, 'td_review', true); @todo $this->td_review variable name must be replaced and the 'get_quotes_on_blocks', 'get_category' methods also
     $this->td_review = get_post_meta($this->post->ID, 'td_post_theme_settings', true);
 }
开发者ID:tuanlibra,项目名称:thptxuanang,代码行数:23,代码来源:td_module.php


示例6: PdfFromItems

 /**
  * show for PDF the webapplications associated with a device
  *
  * @param $pdf
  * @param $item
  *
  **/
 static function PdfFromItems(PluginPdfSimplePDF $pdf, CommonGLPI $item)
 {
     global $DB, $CFG_GLPI;
     $pdf->setColumnsSize(100);
     $pdf->displayTitle('<b>' . _n('Associated web application', 'Associated web applications', 2, 'webapplications') . '</b>');
     $ID = $item->getField('id');
     $itemtype = get_Class($item);
     $canread = $item->can($ID, READ);
     $canedit = $item->can($ID, UPDATE);
     $web = new PluginWebapplicationsWebapplication();
     $query = "SELECT `glpi_plugin_webapplications_webapplications`.* " . " FROM `glpi_plugin_webapplications_webapplications_items`,`glpi_plugin_webapplications_webapplications` " . " LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id` = `glpi_plugin_webapplications_webapplications`.`entities_id`) " . " WHERE `glpi_plugin_webapplications_webapplications_items`.`items_id` = '" . $ID . "' \n         AND `glpi_plugin_webapplications_webapplications_items`.`itemtype` = '" . $itemtype . "' \n         AND `glpi_plugin_webapplications_webapplications_items`.`plugin_webapplications_webapplications_id` = `glpi_plugin_webapplications_webapplications`.`id` " . getEntitiesRestrictRequest(" AND ", "glpi_plugin_webapplications_webapplications", '', '', $web->maybeRecursive());
     $result = $DB->query($query);
     $number = $DB->numrows($result);
     if (!$number) {
         $pdf->displayLine(__('No item found'));
     } else {
         if (Session::isMultiEntitiesMode()) {
             $pdf->setColumnsSize(25, 25, 15, 15, 20);
             $pdf->displayTitle('<b><i>' . __('Name'), __('Entity'), __('Technician in charge of the hardware'), __('Group in charge of the hardware'), PluginWebapplicationsWebapplicationType::getTypeName(1) . '</i></b>');
         } else {
             $pdf->setColumnsSize(30, 30, 20, 20);
             $pdf->displayTitle('<b><i>' . __('Name'), __('Technician in charge of the hardware'), __('Group in charge of the hardware'), PluginWebapplicationsWebapplicationType::getTypeName(1) . '</i></b>');
         }
         while ($data = $DB->fetch_array($result)) {
             $webapplicationsID = $data["id"];
             if (Session::isMultiEntitiesMode()) {
                 $pdf->setColumnsSize(25, 25, 15, 15, 20);
                 $pdf->displayLine($data["name"], Html::clean(Dropdown::getDropdownName("glpi_entities", $data['entities_id'])), Html::clean(getUsername("glpi_users", $data["users_id_tech"])), Html::clean(Dropdown::getDropdownName("glpi_groups", $data["groups_id_tech"])), Html::clean(Dropdown::getDropdownName("glpi_plugin_webapplications_webapplicationtypes", $data["plugin_webapplications_webapplicationtypes_id"])));
             } else {
                 $pdf->setColumnsSize(50, 25, 25);
                 $pdf->displayLine($data["name"], Html::clean(getUsername("glpi_users", $data["users_id_tech"])), Html::clean(Dropdown::getDropdownName("glpi_groups", $data["groups_id_tech"])), Html::clean(Dropdown::getDropdownName("glpi_plugin_webapplications_webapplicationtypes", $data["plugin_webapplications_webapplicationtypes_id"])));
             }
         }
     }
 }
开发者ID:wittwerch,项目名称:webapplications,代码行数:42,代码来源:webapplication_item.class.php


示例7: PdfFromItems

 /** 
  * show for PDF the resources associated with a device
  * 
  * @param $ID of the device
  * @param $itemtype : type of the device
  * 
  */
 static function PdfFromItems($pdf, $item)
 {
     global $DB, $CFG_GLPI;
     $pdf->setColumnsSize(100);
     $pdf->displayTitle('<b>' . __('Associated Human Resource', 'resources') . '</b>');
     $ID = $item->getField('id');
     $itemtype = get_Class($item);
     $canread = $item->can($ID, 'r');
     $canedit = $item->can($ID, 'w');
     $PluginResourcesResource = new PluginResourcesResource();
     $query = "SELECT `glpi_plugin_resources_resources`.* " . " FROM `glpi_plugin_resources_resources_items`,`glpi_plugin_resources_resources` " . " LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id` = `glpi_plugin_resources_resources`.`entities_id`) " . " WHERE `glpi_plugin_resources_resources_items`.`items_id` = '" . $ID . "' \n         AND `glpi_plugin_resources_resources_items`.`itemtype` = '" . $itemtype . "' \n         AND `glpi_plugin_resources_resources_items`.`plugin_resources_resources_id` = `glpi_plugin_resources_resources`.`id` " . getEntitiesRestrictRequest(" AND ", "glpi_plugin_resources_resources", '', '', $PluginResourcesResource->maybeRecursive());
     $result = $DB->query($query);
     $number = $DB->numrows($result);
     if (!$number) {
         $pdf->displayLine(__('No item found'));
     } else {
         if (Session::isMultiEntitiesMode()) {
             $pdf->setColumnsSize(14, 14, 14, 14, 14, 14, 16);
             $pdf->displayTitle('<b><i>' . __('Name'), __('Entity'), __('Location'), PluginResourcesContractType::getTypeName(1), PluginResourcesDepartment::getTypeName(1), __('Arrival date', 'resources'), __('Departure date', 'resources') . '</i></b>');
         } else {
             $pdf->setColumnsSize(17, 17, 17, 17, 17, 17);
             $pdf->displayTitle('<b><i>' . __('Name'), __('Location'), PluginResourcesContractType::getTypeName(1), PluginResourcesDepartment::getTypeName(1), __('Arrival date', 'resources'), __('Departure date', 'resources') . '</i></b>');
         }
         while ($data = $DB->fetch_array($result)) {
             $resourcesID = $data["id"];
             if (Session::isMultiEntitiesMode()) {
                 $pdf->setColumnsSize(14, 14, 14, 14, 14, 14, 16);
                 $pdf->displayLine($data["name"], Html::clean(Dropdown::getDropdownName("glpi_entities", $data['entities_id'])), Html::clean(Dropdown::getDropdownName("glpi_locations", $data["locations_id"])), Html::clean(Dropdown::getDropdownName("glpi_plugin_resources_contracttypes", $data["plugin_resources_contracttypes_id"])), Html::clean(Dropdown::getDropdownName("glpi_plugin_resources_departments", $data["plugin_resources_departments_id"])), Html::convDate($data["date_begin"]), Html::convDate($data["date_end"]));
             } else {
                 $pdf->setColumnsSize(17, 17, 17, 17, 17, 17);
                 $pdf->displayLine($data["name"], Html::clean(Dropdown::getDropdownName("glpi_locations", $data["locations_id"])), Html::clean(Dropdown::getDropdownName("glpi_plugin_resources_contracttypes", $data["plugin_resources_contracttypes_id"])), Html::clean(Dropdown::getDropdownName("glpi_plugin_resources_departments", $data["plugin_resources_departments_id"])), Html::convDate($data["date_begin"]), Html::convDate($data["date_end"]));
             }
         }
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:42,代码来源:resource_item.class.php


示例8: getZhuanTiListByType

 private function getZhuanTiListByType($cmsObjArr)
 {/*{{{*/
     $oldZhuanTiList = ZhuanTiClient::getInstance()->getZhuanTiByDoctorId($cmsObjArr['doctorIds'],50000); 
     $newZhuanTiList = PaperClient::getInstance()->queryPaperListByTag($cmsObjArr['entity']->id,get_Class($cmsObjArr['entity']));
     return CombineZhuanTi::combineZhuanTiList($oldZhuanTiList,$newZhuanTiList);
 }/*}}}*/
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:6,代码来源:papercontroller.php


示例9: __construct

 public function __construct()
 {
     parent::__construct();
     $this->table = get_Class($this);
     $this->load->database();
 }
开发者ID:googlecode-mirror,项目名称:boton-producto-cm-sms,代码行数:6,代码来源:MY_model.php


示例10: pdfForItem

 /**
  * show for PDF the applicatif associated with a device
  *
  * @param $pdf
  * @param $item
  **/
 static function pdfForItem(PluginPdfSimplePDF $pdf, CommonGLPI $item)
 {
     global $DB, $CFG_GLPI;
     $ID = $item->getField('id');
     $itemtype = get_Class($item);
     $canread = $item->can($ID, 'r');
     $canedit = $item->can($ID, 'w');
     $pdf->setColumnsSize(100);
     $pdf->displayTitle("<b>" . __('Associated appliances', 'appliances') . "</b>");
     $query = "SELECT `glpi_plugin_appliances_appliances_items`.`id` AS entID,\n                       `glpi_plugin_appliances_appliances`.*\n                FROM `glpi_plugin_appliances_appliances_items`,\n                     `glpi_plugin_appliances_appliances`\n                LEFT JOIN `glpi_entities`\n                     ON (`glpi_entities`.`id` = `glpi_plugin_appliances_appliances`.`entities_id`)\n                WHERE `glpi_plugin_appliances_appliances_items`.`items_id` = '" . $ID;
     "'\n                      AND `glpi_plugin_appliances_appliances_items`.`itemtype` = '";
     $itemtype;
     "'\n                      AND `glpi_plugin_appliances_appliances_items`.`plugin_appliances_appliances_id`\n                           = `glpi_plugin_appliances_appliances`.`id`" . getEntitiesRestrictRequest(" AND", "glpi_plugin_appliances_appliances", 'entities_id', $item->getEntityID(), true);
     $result = $DB->query($query);
     $number = $DB->numrows($result);
     if (!$number) {
         $pdf->displayLine(__('No item found'));
     } else {
         if (Session::isMultiEntitiesMode()) {
             $pdf->setColumnsSize(30, 30, 20, 20);
             $pdf->displayTitle('<b><i>' . __('Name'), __('Entity'), __('Group'), __('Type') . '</i></b>');
         } else {
             $pdf->setColumnsSize(50, 25, 25);
             $pdf->displayTitle('<b><i>' . __('Name'), __('Group'), __('Type') . '</i></b>');
         }
         while ($data = $DB->fetch_array($result)) {
             $appliancesID = $data["id"];
             if (Session::isMultiEntitiesMode()) {
                 $pdf->setColumnsSize(30, 30, 20, 20);
                 $pdf->displayLine($data["name"], Html::clean(Dropdown::getDropdownName("glpi_entities", $data['entities_id'])), Html::clean(Dropdown::getDropdownName("glpi_groups", $data["groups_id"])), Html::clean(Dropdown::getDropdownName("glpi_plugin_appliances_appliancetypes", $data["plugin_appliances_appliancetypes_id"])));
             } else {
                 $pdf->setColumnsSize(50, 25, 25);
                 $pdf->displayLine($data["name"], Html::clean(Dropdown::getDropdownName("glpi_groups", $data["groups_id"])), Html::clean(Dropdown::getDropdownName("glpi_plugin_appliances_appliancetypes", $data["plugin_appliances_appliancetypes_id"])));
             }
             PluginAppliancesRelation::showList_PDF($pdf, $data["relationtype"], $data["entID"]);
             PluginAppliancesOptvalue_Item::showList_PDF($pdf, $ID, $appliancesID);
         }
     }
     $pdf->displaySpace();
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:46,代码来源:appliance_item.class.php


示例11: preItemUpdate

 static function preItemUpdate(CommonDBTM $item)
 {
     //find container (if not exist, do nothing)
     if (isset($_REQUEST['c_id'])) {
         $c_id = $_REQUEST['c_id'];
     } else {
         $c_id = self::findContainer(get_Class($item), $item->fields['id'], "dom");
         if ($c_id === false) {
             return false;
         }
     }
     //find fields associated to found container
     $field_obj = new PluginFieldsField();
     $fields = $field_obj->find("plugin_fields_containers_id = {$c_id} AND type != 'header'", "ranking");
     //prepare datas to update
     $datas = array('plugin_fields_containers_id' => $c_id, 'items_id' => $item->fields['id']);
     foreach ($fields as $field) {
         if (isset($item->input[$field['name']])) {
             //standard field
             $input = $field['name'];
         } else {
             //dropdown field
             $input = "plugin_fields_" . $field['name'] . "dropdowns_id";
         }
         if (isset($item->input[$input])) {
             $datas[$input] = $item->input[$input];
         }
     }
     //update datas
     $container = new self();
     if ($container->updateFieldsValues($datas)) {
         return true;
     }
     return $item->input = array();
 }
开发者ID:publik1974,项目名称:fields,代码行数:35,代码来源:container.class.php


示例12: DrawColTitles

	private function DrawColTitles() {
		// Método encargado de dibujar los títulos de las columnas..

		$this->code.= '<tr>';
		$i = 0;
		foreach ($this->columns as $col) {
			
			$idHeader = '';
			
			if( get_Class($this->columns[$i]) ==  'ColumnDos' ){ 										
				$idHeader = " id='".$this->columns[$i]->GetIDdivHeader()."' ";										
			}					
				
			if ($col->getVisible()) {		// Si la columna está visible..
				$colStyle = 'style="';
				if (($this->colsSeparator) and ($i < (count($this->columns) - 1)))
					$colStyle.= 'border-right: 1px solid '.$this->colsSeparatorColor.';';

				$width = "";
				if ($this->columns[$i]->getWidth() > 0)
					$width = ' width="'.$this->columns[$i]->getWidth().'"';

				$colStyle.= '"';
				$showMessage = ($this->showProcessMessage)?"true":"false";

				if ($this->orderBy == $i) {
					$img = '';
					if (!strpos($this->orderBy, "_D_")) {
						if ($i > 0)
							$img = '<img border="0" src="/images/grid_asc.gif" title="Ascendente" />';
						$url = $this->BuildUrl(1, $i."_D_");
					}
					else {
						if ($i > 0)
							$img = '<img border="0" src="/images/grid_desc.gif" title="Descendente" />';
						$url = $this->BuildUrl(1, $i);
					}
				}
				else {
					$img = '';
					$url = $this->BuildUrl(1, $i);
				}

				if (($this->columns[$i]->getUseStyleForTitle()) and ($this->columns[$i]->getCellClass() != ""))
					$class = $this->columns[$i]->getCellClass();
				else
					$class = $this->headerStyle;

				$title = "";
				if ($this->columns[$i]->getTitleHint() != "")
					$title = 'title="'.$this->columns[$i]->getTitleHint().'"';
				
				if($this->AsignEventColumn){
					$this->code.= '<td class="'.$class.'" '.$colStyle.$width.'>';
					$this->code.= '<table width="100%" border="0" cellpadding="0" cellspacing="0">';
					$this->code.= '<tr>';
					$this->code.= '<td width="28"></td>';			
					$this->code.= '<td align="center" '.$title.' '.$idHeader.' ><a class="'.$this->titleStyle.'" href="#" onClick="changePage(\''.$url.'\', '.$showMessage.', '.(($this->refreshIntoWindow)?'true':'false').')">'.$col->getTitle().'</a></td>';
					$this->code.= '<td align="right" width="28">'.$img.'</td>';
					$this->code.= '</tr>';
					$this->code.= '</table>';
					$this->code.= '</td>';
				}else{				
					//Esto le quita la animacion a las columnas
					$this->code.= '<td class="'.$class.'" '.$colStyle.$width.'  '.$title.'  '.$idHeader.'  >';
					$this->code.= '<font class='.$this->titleStyle.' >'.$col->getTitle()."</font>";
					$this->code.= '</td>';					
				}				
			}
			$i++;
		}
		$this->code.= '</tr>';
	}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:73,代码来源:gridDos.php


示例13: showAssociated

 static function showAssociated($item, $withtemplate = '')
 {
     global $DB, $CFG_GLPI;
     $display_entity = Session::isMultiEntitiesMode();
     $numcols = 5;
     if ($display_entity) {
         $numcols++;
     }
     $ID = $item->getField('id');
     $itemtype = get_Class($item);
     $entity = $item->getEntityID();
     $showgroup = true;
     if (!class_exists($itemtype)) {
         $datatable = "";
         $form = "";
     } else {
         $objeto = new $itemtype();
         $datatable = $objeto->getTable();
         $form = Toolbox::getItemTypeFormURL($itemtype);
     }
     if ($showgroup) {
         $moreselect = ", g.name AS grp";
         $morejoin = " LEFT JOIN glpi_groups AS g ON d.groups_id = g.id";
     } else {
         $numcols--;
         $moreselect = "";
         $morejoin = "";
     }
     if ($withtemplate != 2) {
         //echo "<form method='post' action=\"".$CFG_GLPI["root_doc"]."/plugins/relation/front/relation.form.php\">";
         echo "<form method='post' name='relation_form' id='add_relation_form'  action=" . PluginRelationRelation::getFormURL(true) . ">";
     }
     echo "<div align='center'><table class='tab_cadre_fixe'>";
     // Children
     $query4 = "SELECT `name` FROM `{$datatable}` WHERE `id` = '{$ID}'";
     $result4 = $DB->query($query4);
     $thisdata = $DB->fetch_array($result4);
     echo "<tr><th colspan='" . $numcols . "'>" . __('Elementos relacionados', 'Elementos relacionados') . "</th></tr>";
     // CRI 26/11/2015 Cambio de orden de columna tipo de relacion
     echo "<tr>";
     if ($showgroup) {
         echo "<th>" . __('Tipo Relacion', 'Tipo Relacion') . "</th>";
     }
     echo "<th>" . __('Nombre', 'Nombre') . "</th>";
     echo "<th>" . __('Estado', 'Estado') . "</th>";
     // CRI 2.0 Añadir Estado del CI 11/12/2014
     if ($display_entity) {
         echo "<th>" . __('Entidad', 'Entidad') . "</th>";
     }
     echo "<th>" . __('Tipo', 'Tipo') . "</th>";
     if (Session::haveRight("plugin_relation", CREATE)) {
         echo "<th>&nbsp;</th>";
     }
     echo "</tr>";
     //imprimo las relaciones directas
     $queryAssociated = "select r.id, r.items_id, r.itemtype, tr.name from glpi_plugin_relation_relations r left join glpi_plugin_relation_typerelations tr on r.relation_type=tr.id  where r.parent_id=";
     $queryAssociated .= $ID . " and r.parent_type='" . $itemtype . "'order by 4,3,2";
     $resultAssociated = $DB->query($queryAssociated);
     if ($DB->numrows($resultAssociated)) {
         while ($data = $DB->fetch_array($resultAssociated)) {
             //print_r($data);
             //echo "<br>";
             $nombreClase = $data['itemtype'];
             $form = Toolbox::getItemTypeFormURL($nombreClase);
             $objAsociado = new $nombreClase();
             $objAsociado->getFromDB($data['items_id']);
             echo '<tr class="tab_bg_1">';
             // CRI 2.0 Cambio de orden de columna tipo de relacion
             if ($showgroup) {
                 echo '<td align="center">' . $data['name'] . '</td>';
             }
             if ($data['itemtype'] == "User") {
                 $user = getUserName($data['items_id'], 2);
                 echo '<td align="center"><a href="' . $form . '?id=' . $data['items_id'] . '">' . getUserName($data['items_id']) . ' (' . $objAsociado->fields['name'] . ")&nbsp;" . Html::showToolTip($user["comment"], array('link' => $user["link"], 'display' => false));
                 //getUserName($data['items_id'])
                 echo '</a></td>';
             } else {
                 echo '<td align="center"><a href="' . $form . '?id=' . $data['items_id'] . '">' . $objAsociado->fields['name'];
                 if ($_SESSION["glpiis_ids_visible"]) {
                     echo " (" . $data["items_id"] . ")";
                 }
                 echo '</a></td>';
             }
             echo '<td align="center">' . PluginRelationRelation::getStatusItem($data['itemtype'], $data['items_id']) . '</td>';
             //CRI 2.0 Añadir Estado del CI 11/12/2014
             if ($display_entity) {
                 if ($objAsociado->fields['entities_id'] == 0) {
                     echo "<td align='center'>" . __('Entidad Raiz', 'Entidad Raiz') . "</td>";
                 } else {
                     echo "<td align='center'>" . Dropdown::getDropdownName("glpi_entities", $objAsociado->fields['entities_id']) . "</td>";
                 }
                 //echo "<td align='center'>".$objAsociado->fields['entities_id']."</td>";
             }
             echo '<td align="center">' . PluginRelationRelation::getViewNameClass($data['itemtype']) . '</td>';
             // Gobierno TI: [olb26s] uso de funcion getViewNameClass
             if (Session::haveRight('plugin_relation', CREATE)) {
                 if ($withtemplate < 2) {
                     echo "<td align='center' class='tab_bg_2'><a href='" . $CFG_GLPI["root_doc"] . "/plugins/relation/front/relation.form.php?deleterelation=deleterelation&amp;id=" . $data['id'] . "'>" . __('Eliminar', 'Eliminar') . "</a></td>";
                 }
             }
//.........这里部分代码省略.........
开发者ID:OscarLoayzaB,项目名称:relation,代码行数:101,代码来源:relation.class.php


示例14: getResponseFile

 public function getResponseFile()
 {
     throw new KurogoDataException("getResponseFile() does not yet work with " . get_Class($this));
 }
开发者ID:sponto,项目名称:Kurogo-Mobile-Web,代码行数:4,代码来源:DataResponse.php


示例15: toValidator

 public function toValidator($command)
 {
     return str_replace('Command', 'Validator', get_Class($command));
 }
开发者ID:stoodz,项目名称:CommanderLesson,代码行数:4,代码来源:CommandTranslator.php


示例16: __construct

 public function __construct()
 {
     $this->log = new logBase(get_Class($this));
 }
开发者ID:bitchunk,项目名称:bitchunk_aws,代码行数:4,代码来源:AjaxServerBase.php


示例17: getQuestionSheetDisplayInfos

    /**
        * @brief 获取问卷展示的信息,同时展示等待状态下健康记录的答案(即未提交的健康记录)
        * @author zjj 
        *
        * @param $questionSheet 问卷
        * @param $patient 患者 
        *
        * @return $questionSheetInfos 问卷展示信息
     */
    private function getQuestionSheetDisplayInfos(QuestionSheet $questionSheet, Patient $patient)
    {/*{{{*/
        $answerContents = PatientFileClient::getInstance()->getAnswerContentsOfWaitRecord4Patient($patient->id);
        $allQuestionInfos = $questionSheet->getWrapperQuestionArr();

        $questionSheetInfos = array();
        $unDisplyWrapperIds = DAL::get()->queryUnDisplayWrapperIdsByPatientId('QuestionWrapper', $patient->id);
        foreach ($allQuestionInfos as $questionInfo)
        {
            $wrapper = $questionInfo['wrapper'];
            //过滤不在展示日期内的问题包
            if (in_array($wrapper->id, $unDisplyWrapperIds))
            {
                continue;
            }

            $questionSheetInfo['wrapperName'] = $wrapper->name;
            if (count($questionInfo['questions']) > 1)
            {
                $questionSheetInfo['type'] = get_Class($wrapper);
                $questionSheetInfo['value'] = $this->getQuestionDisplayInfos($questionInfo['questions'], $answerContents);
            }
            else
            {
                $questionSheetInfo['type'] = get_Class($questionInfo['questions'][0]);
                $questionInfos = $this->getQuestionDisplayInfos($questionInfo['questions'], $answerContents);
                $questionSheetInfo['value'] = array_shift($questionInfos);
            }
            $questionSheetInfos[] = $questionSheetInfo;
        }

        return $questionSheetInfos;
    }/*}}}*/
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:42,代码来源:patientfiledatabucket.php


示例18: PdfFromItems

 /** 
  * show for PDF the projet associated with a device
  * 
  * @param $ID of the device
  * @param $itemtype : type of the device
  * 
  */
 static function PdfFromItems($pdf, $item)
 {
     global $DB, $CFG_GLPI;
     $pdf->setColumnsSize(100);
     $pdf->displayTitle('<b>' . _n('Associated project', 'Associated projects', 2, 'projet') . '</b>');
     $ID = $item->getField('id');
     $itemtype = get_Class($item);
     $canread = $item->can($ID, 'r');
     $canedit = $item->can($ID, 'w');
     $PluginProjetProjet = new PluginProjetProjet();
     $query = "SELECT `glpi_plugin_projet_projets`.* " . " FROM `glpi_plugin_projet_projets_items`,`glpi_plugin_projet_projets` " . " LEFT JOIN `glpi_entities` ON (`glpi_entities`.`id` = `glpi_plugin_projet_projets`.`entities_id`) " . " WHERE `glpi_plugin_projet_projets_items`.`items_id` = '" . $ID . "' \n         AND `glpi_plugin_projet_projets_items`.`itemtype` = '" . $itemtype . "' \n         AND `glpi_plugin_projet_projets_items`.`plugin_projet_projets_id` = `glpi_plugin_projet_projets`.`id` " . getEntitiesRestrictRequest(" AND ", "glpi_plugin_projet_projets", '', '', $PluginProjetProjet->maybeRecursive());
     $result = $DB->query($query);
     $number = $DB->numrows($result);
     if (!$number) {
         $pdf->displayLine(__('No item found'));
     } else {
         if (Session::isMultiEntitiesMode()) {
             $pdf->setColumnsSize(14, 14, 14, 14, 14, 14, 16);
             $pdf->displayTitle('<b><i>' . __('Name'), __('Entity'), __('Comments'), __('Description'), __('Progress'), __('Start date'), __('End date') . '</i></b>');
         } else {
             $pdf->setColumnsSize(17, 17, 17, 17, 17, 17);
             $pdf->displayTitle('<b><i>' . __('Name'), __('Comments'), __('Description'), __('Progress'), __('Start date'), __('End date') . '</i></b>');
         }
         while ($data = $DB->fetch_array($result)) {
             if (Session::isMultiEntitiesMode()) {
                 $pdf->setColumnsSize(14, 14, 14, 14, 14, 14, 16);
                 $pdf->displayLine($data["name"], Html::clean(Dropdown::getDropdownName("glpi_entities", $data['entities_id'])), $data["comment"], $data["description"], PluginProjetProjet::displayProgressBar('100', $data["advance"], array("simple" => true)), Html::convdate($data["date_begin"]), Html::convdate($data["date_end"]));
             } else {
                 $pdf->setColumnsSize(17, 17, 17, 17, 17, 17);
                 $pdf->displayLine($data["name"], $data["comment"], $data["description"], PluginProjetProjet::displayProgressBar('100', $data["advance"], array("simple" => true)), Html::convdate($data["date_begin"]), Html::convdate($data["date_end"]));
             }
         }
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:41,代码来源:projet_item.class.php


示例19: submit

 /**
  * Submits a new query to the database.
  * @param string $formstring name of the form to use
  * @param array $formParams
  * @return array $response
  */
 public function submit($formstring, array $formParams = array())
 {
     // get the formclass
     $formConfig = Daiquiri_Config::getInstance()->query->forms->{$formstring};
     if ($formConfig === null || get_Class($formConfig) !== 'Zend_Config') {
         throw new Exception('form options not found');
     } else {
         $formOptions = $formConfig->toArray();
         $formOptions['name'] = $formstring;
     }
     // get queues
     $resource = Query_Model_Resource_AbstractQuery::factory();
     $queues = array();
     $defaultQueue = false;
     if ($resource::$hasQueues === true) {
         try {
             $queues = $resource->fetchQueues();
             $defaultQueue = $resource->fetchDefaultQueue();
         } catch (Exception $e) {
             return array('status' => 'error');
         }
         $usrGrp = Daiquiri_Auth::getInstance()->getCurrentRole();
         foreach ($queues as $key => $value) {
             // show only the guest queue for the guest user:
             if ($value['name'] !== "guest" && $usrGrp === "guest") {
                 unset($queues[$key]);
             }
             // remove the guest queue if this is a non guest user
             if ($value['name'] === "guest" && $usrGrp !== "guest") {
                 unset($queues[$key]);
             }
         }
     }
     // get the form
     $form = new $formConfig->class(array('formOptions' => $formOptions, 'queues' => $queues, 'defaultQueue' => $defaultQueue));
     // init errors array
     $errors = array();
     // validate form
     if (!empty($formParams)) {
         if ($form->isValid($formParams)) {
             // form is valid, get sql string from functions
             $sql = $form->getQuery();
             $tablename = $form->getTablename();
             $queueId = $form->getQueue();
             //clean from default flag
             $queueId = str_replace("_def", "", $queueId);
             if (empty($tablename)) {
                 $tablename = null;
             }
             $options = array();
             if (!empty($queueId)) {
                 $options['queue'] = $queues[$queueId]['name'];
             }
             // validate query
             $model = new Query_Model_Query();
             if ($model->validate($sql, false, $tablename, $errors) !== true) {
                 // set description for form
                 $form->setDescription(implode('; ', $errors));
                 // construct response array
                 return array('form' => $form, 'formOptions' => $formOptions, 'status' => 'error', 'errors' => array('form' => $errors));
             }
             // take a detour to the query plan
             if ($model->canShowPlan()) {
                 // store query, tablename and queue in session
                 Zend_Session::namespaceUnset('query_plan');
                 $ns = new Zend_Session_Namespace('query_plan');
                 $ns->sql = $sql;
                 $ns->tablename = $tablename;
                 if (isset($options['queue'])) {
                     $ns->queue = $options['queue'];
                 } else {
                     $ns->queue = null;
                 }
                 $ns->plan = $model->plan($sql, $errors);
                 if (!empty($errors)) {
                     return $this->getModelHelper('CRUD')->validationErrorResponse($form, $errors);
                 }
                 // construct response with redirect to plan
                 $baseurl = Daiquiri_Config::getInstance()->getSiteUrl();
                 return array('status' => 'plan', 'redirect' => $baseurl . '/query/form/plan?form=' . $formstring);
             } else {
                 // submit query
                 $response = $model->query($sql, false, $tablename, $options);
                 if ($response['status'] === 'ok') {
                     // submitting the query was successful
                     return $response;
                 } else {
                     // set description for form
                     $form->setDescription(implode('; ', $response['errors']));
                     // construct response array
                     return array('form' => $form, 'formOptions' => $formOptions, 'status' => 'error', 'errors' => array('form' => $response['errors']));
                 }
             }
         } else {
//.........这里部分代码省略.........
开发者ID:vrtulka23,项目名称:daiquiri,代码行数:101,代码来源:Form.php


示例20: showBox

 /**
  *	Standard method to show a box (usage by boxes not mandatory, a box can still use its own function)
  *
  *	@param	array	$head       Array with properties of box title
  *	@param  array	$contents   Array with properties of box lines
  *	@return	void
  */
  

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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