PageRenderTime 1133ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/Quản lý công ty du lịch khách sạn PHP/sgncnew/administrator/components/com_joomfish/models/ContentElementTableField.php

https://gitlab.com/phamngsinh/baitaplon_sinhvien
PHP | 127 lines | 65 code | 12 blank | 50 comment | 14 complexity | b460463938f83202c53a707850cad5dc MD5 | raw file
  1. <?php
  2. /**
  3. * Joom!Fish - Multi Lingual extention and translation manager for Joomla!
  4. * Copyright (C) 2003-2009 Think Network GmbH, Munich
  5. *
  6. * All rights reserved. The Joom!Fish project is a set of extentions for
  7. * the content management system Joomla!. It enables Joomla!
  8. * to manage multi lingual sites especially in all dynamic information
  9. * which are stored in the database.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License
  13. * as published by the Free Software Foundation; either version 2
  14. * of the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
  24. *
  25. * The "GNU General Public License" (GPL) is available at
  26. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  27. * -----------------------------------------------------------------------------
  28. * $Id: ContentElementTableField.php 1391 2009-08-10 12:40:55Z geraint $
  29. * @package joomfish
  30. * @subpackage Models
  31. *
  32. */
  33. // Don't allow direct linking
  34. defined( 'JPATH_BASE' ) or die( 'Direct Access to this location is not allowed.' );
  35. /**
  36. * Description of a table field
  37. *
  38. * @package joomfish
  39. * @subpackage administrator
  40. * @copyright 2003-2009 Think Network GmbH
  41. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
  42. * @version $Revision: 1296 $
  43. * @author Alex Kempkens <joomfish@thinknetwork.com>
  44. */
  45. class ContentElementTablefield {
  46. var $Type='';
  47. var $Name='';
  48. var $Lable='';
  49. var $Translate=false;
  50. var $Option='';
  51. var $Length=30;
  52. var $MaxLength=80;
  53. var $Rows=15;
  54. var $Columns=30;
  55. var $posthandler="";
  56. var $prehandler="";
  57. var $prehandleroriginal="";
  58. var $prehandlertranslation="";
  59. // Can be boolean or array, if boolean defines if the buttons are displayed, if array defines a list of buttons not to show.
  60. var $ebuttons=true;
  61. // boolean to determine where to show this field if original is not blank e.g. content in modules
  62. var $ignoreifblank=0;
  63. /** originalValue value of the corresponding content table */
  64. var $originalValue;
  65. /** translationContent reference to the actual translation db object */
  66. var $translationContent;
  67. /** changed Flag that says if a field is changed or not */
  68. var $changed=false;
  69. /** this Flag explains if the original is empty or not */
  70. var $originalEmpty=false;
  71. /** Standard constructur
  72. */
  73. function ContentElementTablefield( $tablefieldElement ) {
  74. $this->Type = trim( $tablefieldElement->getAttribute( 'type' ) );
  75. $this->Name = trim( $tablefieldElement->getAttribute( 'name' ) );
  76. $this->Lable = trim( $tablefieldElement->getText() );
  77. $this->Translate = trim( $tablefieldElement->getAttribute( 'translate' ) );
  78. $this->Option = trim( $tablefieldElement->getAttribute( 'option' ) );
  79. $this->Length = intval( $tablefieldElement->getAttribute( 'length' ) );
  80. $this->MaxLength = intval( $tablefieldElement->getAttribute( 'maxlength' ) );
  81. $this->Rows = intval( $tablefieldElement->getAttribute( 'rows' ) );
  82. $this->Columns = intval( $tablefieldElement->getAttribute( 'columns' ) );
  83. $this->posthandler = trim( $tablefieldElement->getAttribute( 'posthandler' ) );
  84. $this->prehandler = trim( $tablefieldElement->getAttribute( 'prehandler' ) );
  85. $this->prehandlertranslation = trim( $tablefieldElement->getAttribute( 'prehandlertranslation' ) );
  86. $this->prehandleroriginal = trim( $tablefieldElement->getAttribute( 'prehandleroriginal' ) );
  87. $this->ignoreifblank = intval( $tablefieldElement->getAttribute( 'ignoreifblank' ) );
  88. $this->ebuttons = trim( $tablefieldElement->getAttribute( 'ebuttons' ) );
  89. if (strpos($this->ebuttons,",")>0){
  90. $this->ebuttons = explode(",",$this->ebuttons);
  91. }
  92. else if ($this->ebuttons=="1" || strtolower($this->ebuttons)=="true"){
  93. $this->ebuttons = true;
  94. }
  95. else if (strlen($this->ebuttons)==0) {
  96. $this->ebuttons = array("readmore");
  97. }
  98. else if ($this->ebuttons=="0" || strtolower($this->ebuttons)=="false"){
  99. $this->ebuttons = false;
  100. }
  101. else if (strlen($this->ebuttons)>0){
  102. $this->ebuttons = array($this->ebuttons);
  103. }
  104. }
  105. function preHandle($element){
  106. if ($this->prehandler!="" && method_exists($this,$this->prehandler)){
  107. $prehandler=$this->prehandler;
  108. $this->$prehandler($element);
  109. }
  110. }
  111. function checkUrlType($element){
  112. if ($element->IndexedFields["type"]->originalValue=="url") $this->Type="text";
  113. }
  114. }
  115. ?>