Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Fatal error: Class 'CForm'
Forum PHP.pl > Forum > PHP
Julcio
Witajcie!
Mam pewien problem. Po zainstalowaniu custom CMS'a wchodząc na stronę główną pojawia się biały ekran z tym błędem:
Cytat
Fatal error: Class 'CForm' not found in /home/julcio/public_html/v2/admin/lib/forms.settings.php on line 23


Przedstawiam plik forms.settings.php od linijki 23
  1. class CFormSettings extends CForm{
  2. function CFormSettings($xml , $templates , $db , $tables) {
  3. parent::CForm($templates, $db , $tables,$xml);
  4. $this->name = "formsettings";
  5.  
  6. $this->method = strtoupper($this->form["method"] ? $this->form["method"] : "post");
  7. }
  8.  
  9. /**
  10. * description
  11. *
  12. * @param
  13. *
  14. * @return
  15. *
  16. * @access
  17. */
  18. function Show($values , $extra = array()) {
  19. //check if i should show the details
  20. if (is_array($this->_errors)) {
  21. $edit = true;
  22. } else {
  23. if ($_SERVER["REQUEST_METHOD"] == "POST") {
  24. //redirect to the showing mode;
  25. $location = new CTemplate($this->form["redirect"] , "string");
  26. URLRedirect($location->Replace(parent::GlobalVars($this->form)) , "js");
  27. } else
  28.  
  29. $edit = $_GET["action"] == "edit" || $_GET["action"] == "store" ? true : false;
  30. }
  31.  
  32. if ($edit == false) {
  33.  
  34. //convert the editable fields to the showing ones
  35. if (is_array($this->form["fields"])) {
  36. parent::__private__showonly(&$this->form);
  37. }
  38.  
  39. //remove the edit and back buttons
  40.  
  41. if (!$_GET["returnurl"])
  42. unset($this->form["buttons"]["back"]);
  43.  
  44. unset($this->form["buttons"]["save"]);
  45. unset($this->form["action"]);
  46.  
  47.  
  48. } else {
  49. //remove the edit button
  50. unset($this->form["buttons"]["edit"]);
  51. }
  52.  
  53. return parent::Show(
  54. $this->form ,
  55. is_array($this->_errors) ? $this->_errors : array(
  56. "values" => $values,
  57. "error" => $this->error
  58. ),
  59. $extra
  60. );
  61. }
  62.  
  63. /**
  64. * description
  65. *
  66. * @param
  67. *
  68. * @return
  69. *
  70. * @access
  71. */
  72. function Validate() {
  73.  
  74. if ($_SERVER["REQUEST_METHOD"] != $this->method)
  75. return 1;
  76.  
  77. if ($this->method == "GET" )
  78. $data = &$_GET ;
  79. else
  80. $data = &$_POST;
  81.  
  82.  
  83. CForm::ProcessVariables($this->form, $data);
  84.  
  85. $this->_errors = parent::Validate($this->form , $data);
  86.  
  87. $this->valid = !(int)is_array($this->_errors);
  88.  
  89. //$this->__private_process_uploads();
  90. }
  91.  
  92. function Done() {
  93.  
  94. $this->Validate();
  95. $this->Uploads();
  96.  
  97. if ($this->valid) {
  98. if ($_SERVER["REQUEST_METHOD"] == "POST") {
  99. $this->DoUploads();
  100. return true;
  101. }
  102. }
  103.  
  104. return false;
  105. }
  106.  
  107. /**
  108. * description
  109. *
  110. * @param
  111. *
  112. * @return
  113. *
  114. * @access
  115. */
  116. function Uploads() {
  117.  
  118. if (is_array($this->form["fields"])) {
  119. foreach ($this->form["fields"] as $key => $val) {
  120.  
  121. if (!$val["name"])
  122. $val["name"] = $key;
  123.  
  124. switch ($val["type"]) {
  125. case "upload":
  126. case "image":
  127.  
  128. $this->__private_uploads_pre($val);
  129. break;
  130. }
  131.  
  132. }
  133. }
  134. }
  135.  
  136.  
  137. /**
  138. * description
  139. *
  140. * @param
  141. *
  142. * @return
  143. *
  144. * @access
  145. */
  146. function DoUploads() {
  147.  
  148. if (is_array($this->form["fields"])) {
  149. foreach ($this->form["fields"] as $key => $val) {
  150. if (!$val["name"])
  151. $val["name"] = $key;
  152.  
  153. switch ($val["type"]) {
  154. case "upload":
  155. case "image":
  156. $this->__private_uploads_after($val);
  157.  
  158.  
  159. //remove the extra fields
  160. unset($_POST["portfolio_img_temp"]);
  161. unset($_POST["portfolio_img_radio_type"]);
  162. unset($_POST["portfolio_img_upload_web"]);
  163. break;
  164. }
  165.  
  166. }
  167. }
  168. }
  169.  
  170.  
  171.  
  172.  
  173. function DoEvents(){
  174. }
  175. }
skowron-line
Nie masz dołączonego pliku z klasą CForm do pliku orms.settings.php
Julcio
Cytat(skowron-line @ 22.07.2013, 11:40:15 ) *
Nie masz dołączonego pliku z klasą CForm do pliku orms.settings.php

A prościej? Wybacz, ale jestem zielony w PHP.
!*!
  1. include_once 'sciezka_do_pliku_z_klasa'; //wstaw to do pliku w którym wywołujesz klasę, lub jeśli CMS to posiada, zdeklaruj to jakoś w autoloaderze
Julcio
Wrzuciłem tą linijkę do index.php

Cytat
Warning: require_once(_LIBPATHforms.php) [function.require-once]: failed to open stream: No such file or directory in /home/julcio/public_html/slick/admin/lib/forms.settings.php on line 13

Fatal error: require_once() [function.require]: Failed opening required '_LIBPATHforms.php' (include_path='.') in /home/julcio/public_html/slick/admin/lib/forms.settings.php on line 13


Drugi CMS od tego samego autora też zawiera ten sam błąd, może to nie wina kodu, a gdzieś indziej leży przyczyna?
!*!
Ścieżka nie jest poprawna. Jak już to
  1. _LIBPATH.'forms.php'
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.