Advertisement
Guest User

Untitled

a guest
Nov 7th, 2019
81
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for Zend Guard Encoder)
  6. *
  7. * @ Version : 3.0.4.0
  8. * @ Author : DeZender
  9. * @ Release on : 02.04.2017
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14.  
  15. class BlinkFW_Activity extends BlinkFW_Content
  16. {
  17. const prefijo_cachekey = 'clase_';
  18. const search_cache_key = 'search_activity_cache';
  19. const search_cache_key_repositorio = 'search_repository_activity_cache';
  20. const TYPE = -1;
  21. const THUMBNAIL_DEFAULT_WIDTH = 100;
  22. const THUMBNAIL_DEFAULT_HEIGHT = 100;
  23. const THUMBNAIL_ATTACHMENT_WIDTH = 103;
  24. const THUMBNAIL_ATTACHMENT_HEIGHT = 135;
  25. const THUMBNAIL_RESOURCE_WIDTH = 144;
  26. const THUMBNAIL_RESOURCE_HEIGHT = 190;
  27. const DEFAULT_NUM_SLIDES_PER_EXAM = 8;
  28.  
  29. protected $IDCLASE;
  30. protected $IDCURSO;
  31. protected $TIPO_CLASE;
  32. protected $EVAL_TYPE;
  33. protected $REPEATABLE;
  34. protected $SECUENCIA;
  35. protected $ORDEN;
  36. protected $DESCRIPCION;
  37. protected $CODIGO_CORTO;
  38. protected $TIEMPOLIMITE;
  39. protected $IDTEMA;
  40. protected $PONDERACION;
  41. protected $EXTRA;
  42. protected $IMAGEN;
  43. protected $SETTINGS;
  44. protected $NIVEL_INDICE;
  45. protected $IDTIPOLICENCIA;
  46. protected $LICENCIA;
  47. protected $BLOQUEADO;
  48. protected $TIPO_CONTENIDO;
  49. protected $IDCLASEORIGINAL;
  50. protected $FILTER;
  51. protected $COMMITCOMPLETE;
  52. protected $ISRESOURCE;
  53. protected $IDCLASE_EXT;
  54. protected $RegistroAcceso;
  55. protected $IDUSUARIOAUTOR;
  56. protected $IDUSEROWNER;
  57. protected $ONLINE;
  58. protected $VISIBLE;
  59. protected $BORRADO;
  60. protected $SCORM_VERSION;
  61. protected $_imagePath;
  62. protected $_imagePath_thumbnail;
  63. protected $_numTransparencias;
  64. static public $CAMPOS_SINC_ORIGINAL = array('TIPO_CONTENIDO');
  65. static public $CAMPOS_SINC_COPIA = array('TIPO_CONTENIDO', 'EXTRA');
  66. protected $HAS_MEDIARESOURCES;
  67. protected $_arrSlidesDB;
  68.  
  69. public function __construct()
  70. {
  71. parent::__construct();
  72. parent::$customizationTable = 'blinkfw_activities_customization';
  73. parent::$customizationFields = array('TIPO_CLASE', 'NOMBRE', 'DESCRIPCION', 'CODIGO_CORTO', 'IDASIGNATURA', 'EDADRECOMENDADA', 'EJE_CATEGORIAS', 'IDIOMA', 'NUM_VOTOS', 'ORDEN', 'FECHA_ULT_MODIF', 'DOMINIO', 'TIEMPOLIMITE', 'IDTEMA', 'BORRADO', 'VISIBLE', 'PONDERACION', 'EXTRA', 'IMAGEN', 'SETTINGS', 'NIVEL_INDICE', 'IDUSUARIOAUTOR', 'IDUSEROWNER', 'ONLINE', 'BLOQUEADO', 'TIPO_CONTENIDO', 'EVAL_TYPE', 'REPEATABLE', 'FILTER', 'INCOMPATIBLE_DEVICES', 'SCORM_VERSION', 'CONTENT_STYLE', 'COMMITCOMPLETE', 'ISRESOURCE');
  74. parent::$customizationIdField = 'IDCURSO';
  75. parent::$customizationPrimaryKeyField = 'IDCLASE';
  76. parent::$customizationDateModifiedField = 'FECHA_ULT_MODIF';
  77. $this->setAccessControl(TYPE_ACCESS_FREE);
  78. $this->setNivelIndice(1);
  79. $this->setVisible(1);
  80. $this->setPonderacion(1);
  81. $this->setIsResource(0);
  82. }
  83.  
  84. static public function getObjectIDCacheKey($speaddc6, $spdbf624 = 0)
  85. {
  86. return self::prefijo_cachekey . $speaddc6 . ($spdbf624 ? '_' . $spdbf624 : '');
  87. }
  88.  
  89. public function checkCustomization($spdbf624)
  90. {
  91. if ($spdbf624 && ($spdbf624 != $this->getIDCurso())) {
  92. $sp2fef01 = ObjectFactory::invokeStatic(ObjectFactory::Course)->getObjectFromID($spdbf624);
  93.  
  94. if (!$sp2fef01 || ($sp2fef01->getIDCursoOriginal() != $this->getIDCurso())) {
  95. return false;
  96. }
  97. }
  98.  
  99. return true;
  100. }
  101.  
  102. public function belongsTo($sp39c2bd)
  103. {
  104. if (array_search($sp39c2bd, array($this->getIDCurso(), $this->getIDCustomization())) !== false) {
  105. return true;
  106. }
  107.  
  108. $sp0dadf9 = ObjectFactory::invokeStatic(ObjectFactory::Course)->getObjectFromID($sp39c2bd);
  109.  
  110. if ($sp0dadf9 && ($sp0dadf9->getIDCursoOriginal() == $this->getIDCurso())) {
  111. return true;
  112. }
  113.  
  114. return false;
  115. }
  116.  
  117. public function fillObj($sp56a32c)
  118. {
  119. $this->rellenarClase($sp56a32c);
  120. }
  121.  
  122. static public function getObjectFromData($sp56a32c)
  123. {
  124. if (in_array($sp56a32c['TIPO_CLASE'], array(TIPO_CLASE_FORO, TIPO_CLASE_WIKI, TIPO_CLASE_CHAT)) !== false) {
  125. $spc4f300 = ObjectFactory::createObjForType(ObjectFactory::Activity, $sp56a32c['TIPO_CLASE']);
  126. }
  127. else {
  128. $spc4f300 = ObjectFactory::createObj(ObjectFactory::Activity);
  129. }
  130.  
  131. $spc4f300->fillObj($sp56a32c);
  132. $spc4f300->getNumTransparencias();
  133. $spc4f300->_arrSlidesDB = explode(',', $spc4f300->SECUENCIA);
  134. return $spc4f300;
  135. }
  136.  
  137. public function _borrarObjetoCache()
  138. {
  139. self::borrarObjetoCache($this->getID(), $this->getIDCurso() != $this->getIDCustomization() ? $this->getIDCustomization() : 0);
  140. }
  141.  
  142. static public function borrarObjetoCache($speaddc6, $spdbf624 = 0)
  143. {
  144. FWUtils::log(BlinkFW_LogFile::LEVEL_DEBUG, 'Borrando cache clase = ' . $speaddc6);
  145. ObjectFactory::invokeStatic(ObjectFactory::Memcache)->delete(self::getObjectIDCacheKey($speaddc6, $spdbf624));
  146. }
  147.  
  148. static public function getTypeIdentifier()
  149. {
  150. return static::TYPE;
  151. }
  152.  
  153. public function getObjTemplateName($sp623200 = false)
  154. {
  155. return 'course/class.tpl';
  156. }
  157.  
  158. public function setIDClase($sp2e5db5)
  159. {
  160. $this->IDCLASE = $sp2e5db5;
  161. }
  162.  
  163. public function setIDCurso($sp2e5db5)
  164. {
  165. $this->IDCURSO = $sp2e5db5;
  166. }
  167.  
  168. public function setIDTema($sp2e5db5)
  169. {
  170. $this->IDTEMA = $sp2e5db5;
  171. }
  172.  
  173. public function setTipoClase($sp2e5db5)
  174. {
  175. $this->TIPO_CLASE = $sp2e5db5;
  176. }
  177.  
  178. public function setEvalType($sp2e5db5)
  179. {
  180. $this->EVAL_TYPE = $sp2e5db5;
  181. }
  182.  
  183. public function setRepeatable($sp2e5db5)
  184. {
  185. $this->REPEATABLE = $sp2e5db5;
  186. }
  187.  
  188. public function setSecuencia($sp2e5db5)
  189. {
  190. $this->SECUENCIA = $sp2e5db5;
  191. }
  192.  
  193. public function setOrden($sp2e5db5)
  194. {
  195. $this->ORDEN = $sp2e5db5;
  196. }
  197.  
  198. public function setDescripcion($sp2e5db5)
  199. {
  200. $this->DESCRIPCION = $sp2e5db5;
  201. }
  202.  
  203. public function setCodigoCorto($sp2e5db5)
  204. {
  205. $this->CODIGO_CORTO = $sp2e5db5;
  206. }
  207.  
  208. public function setTiempoLimite($sp2e5db5)
  209. {
  210. $this->TIEMPOLIMITE = $sp2e5db5;
  211. }
  212.  
  213. public function setVisible($sp2e5db5)
  214. {
  215. $this->VISIBLE = $sp2e5db5;
  216. }
  217.  
  218. public function setBorrado($sp2e5db5)
  219. {
  220. $this->BORRADO = $sp2e5db5;
  221. }
  222.  
  223. public function setPonderacion($sp2e5db5)
  224. {
  225. $this->PONDERACION = $sp2e5db5;
  226. }
  227.  
  228. public function setExtra($sp2e5db5)
  229. {
  230. $this->EXTRA = ObjectFactory::invokeStatic(ObjectFactory::Course)->adjustPath($sp2e5db5, false);
  231. }
  232.  
  233. public function setFirstPageAlign($sp2e5db5)
  234. {
  235. $spf7d841 = explode(',', $this->EXTRA);
  236.  
  237. if (4 < count($spf7d841)) {
  238. $spf7d841[5] = $sp2e5db5;
  239. $this->EXTRA = implode(',', $spf7d841);
  240. }
  241. }
  242.  
  243. public function setPageMode($sp2e5db5)
  244. {
  245. $spf7d841 = explode(',', $this->EXTRA);
  246.  
  247. if (7 < count($spf7d841)) {
  248. $spf7d841[8] = $sp2e5db5;
  249. $this->EXTRA = implode(',', $spf7d841);
  250. }
  251. }
  252.  
  253. public function setPagesOffset($sp2e5db5)
  254. {
  255. $spf7d841 = explode(',', $this->EXTRA);
  256. $sp918dc3 = 0;
  257.  
  258. for (; $sp918dc3 <= 9; $sp918dc3++) {
  259. if (!array_key_exists($sp918dc3, $spf7d841)) {
  260. $spf7d841[$sp918dc3] = '';
  261. }
  262. }
  263.  
  264. $spf7d841[9] = $sp2e5db5;
  265. $this->EXTRA = implode(',', $spf7d841);
  266. }
  267.  
  268. public function setImagen($sp2e5db5)
  269. {
  270. $this->IMAGEN = $sp2e5db5;
  271. }
  272.  
  273. public function setSettings($sp2e5db5)
  274. {
  275. $this->SETTINGS = $sp2e5db5;
  276. }
  277.  
  278. public function setIDClaseExt($sp2e5db5)
  279. {
  280. $this->IDCLASE_EXT = $sp2e5db5;
  281. }
  282.  
  283. public function setNivelIndice($sp2e5db5)
  284. {
  285. $this->NIVEL_INDICE = $sp2e5db5;
  286. }
  287.  
  288. public function setIDUsuarioAutor($sp2e5db5)
  289. {
  290. $this->IDUSUARIOAUTOR = $sp2e5db5;
  291. }
  292.  
  293. public function setIDUserOwner($sp2e5db5)
  294. {
  295. $this->IDUSEROWNER = $sp2e5db5;
  296. }
  297.  
  298. public function setIDTipoLicencia($sp2e5db5)
  299. {
  300. $this->IDTIPOLICENCIA = $sp2e5db5;
  301. }
  302.  
  303. public function setLicencia($sp2e5db5)
  304. {
  305. $this->LICENCIA = $sp2e5db5;
  306. }
  307.  
  308. public function setOnline($sp2e5db5)
  309. {
  310. $this->ONLINE = $sp2e5db5;
  311. }
  312.  
  313. public function setBloqueado($sp2e5db5)
  314. {
  315. $this->BLOQUEADO = $sp2e5db5;
  316. }
  317.  
  318. public function setTipoContenido($sp2e5db5)
  319. {
  320. $this->TIPO_CONTENIDO = $sp2e5db5;
  321. }
  322.  
  323. public function setIDClaseOriginal($sp2e5db5)
  324. {
  325. $this->IDCLASEORIGINAL = $sp2e5db5;
  326. }
  327.  
  328. public function setFilter($sp2e5db5)
  329. {
  330. $this->FILTER = $sp2e5db5;
  331. }
  332.  
  333. public function setCommitComplete($sp2e5db5)
  334. {
  335. $this->COMMITCOMPLETE = $sp2e5db5;
  336. }
  337.  
  338. public function setIsResource($sp2e5db5)
  339. {
  340. $this->ISRESOURCE = $sp2e5db5;
  341. }
  342.  
  343. public function setScormVersion($sp2e5db5)
  344. {
  345. $this->SCORM_VERSION = $sp2e5db5;
  346. }
  347.  
  348. public function setScormID($sp2e5db5)
  349. {
  350. $this->setSettings($sp2e5db5);
  351. }
  352.  
  353. public function getID()
  354. {
  355. return $this->IDCLASE;
  356. }
  357.  
  358. public function getIDClase()
  359. {
  360. return $this->IDCLASE;
  361. }
  362.  
  363. public function getIDCurso()
  364. {
  365. return $this->getIDCustomization() ? $this->getIDCustomization() : $this->IDCURSO;
  366. }
  367.  
  368. public function getIDTema()
  369. {
  370. return $this->IDTEMA;
  371. }
  372.  
  373. public function getTema()
  374. {
  375. return ObjectFactory::invokeStatic(ObjectFactory::Section)->getObjectFromID($this->getIDTema(), $this->getIDCustomization());
  376. }
  377.  
  378. public function getTipoClase()
  379. {
  380. return $this->TIPO_CLASE;
  381. }
  382.  
  383. public function getEvalType()
  384. {
  385. return $this->EVAL_TYPE;
  386. }
  387.  
  388. public function getRepeatable()
  389. {
  390. return $this->REPEATABLE;
  391. }
  392.  
  393. public function esAccesoEditorial()
  394. {
  395. return strpos($this->EXTRA, 'accesoContenidoEditorial.php') !== false;
  396. }
  397.  
  398. public function esWebExterna()
  399. {
  400. return ($this->TIPO_CLASE == TIPO_CLASE_WEB) && ((strpos($this->EXTRA, '://') !== false) || $this->esAccesoEditorial());
  401. }
  402.  
  403. public function esArchivo()
  404. {
  405. return ($this->TIPO_CLASE == TIPO_CLASE_WEB) && !$this->esWebExterna();
  406. }
  407.  
  408. public function esArchivoHtml()
  409. {
  410. if (!$this->esArchivo()) {
  411. return false;
  412. }
  413.  
  414. $spcd353a = getExt($this->EXTRA, true);
  415. return ($spcd353a == 'htm') || ($spcd353a == 'html');
  416. }
  417.  
  418. public function esScorm()
  419. {
  420. return ($this->TIPO_CLASE == TIPO_CLASE_WEB) && ObjectFactory::invokeStatic(ObjectFactory::File)->isSCORMLogicalPath($this->EXTRA);
  421. }
  422.  
  423. public function esArchivoEpub()
  424. {
  425. if (!$this->esArchivo()) {
  426. return false;
  427. }
  428.  
  429. $spcd353a = getExt($this->EXTRA, true);
  430. return ($spcd353a == 'epub') || ($spcd353a == 'bpub');
  431. }
  432.  
  433. public function esDeber()
  434. {
  435. return $this->EVAL_TYPE == EVAL_TYPE_HOMEWORK;
  436. }
  437.  
  438. public function esIndiceCurso()
  439. {
  440. $sp0dadf9 = $this->getCurso();
  441.  
  442. if ($sp0dadf9 == NULL) {
  443. return false;
  444. }
  445.  
  446. return $this->IDCLASE === $sp0dadf9->getIDCourseIndex();
  447. }
  448.  
  449. public function visualizarEnPopup()
  450. {
  451. return $this->esAccesoEditorial();
  452. }
  453.  
  454. public function esActividadBlink()
  455. {
  456. return $this->TIPO_CLASE == TIPO_CLASE_EJERCICIO;
  457. }
  458.  
  459. public function esLibroDigital()
  460. {
  461. return $this->TIPO_CLASE == TIPO_CLASE_LIBRO_DIGITAL;
  462. }
  463.  
  464. public function esEvaluable()
  465. {
  466. return $this->EVAL_TYPE != EVAL_TYPE_NOEVAL;
  467. }
  468.  
  469. public function hasMediaResources()
  470. {
  471. return $this->HAS_MEDIARESOURCES;
  472. }
  473.  
  474. public function getExtraInfo()
  475. {
  476. if ($this->EXTRA != '') {
  477. if ($this->esAccesoEditorial()) {
  478. return '';
  479. }
  480.  
  481. if ($this->TIPO_CLASE == TIPO_CLASE_LIBRO_DIGITAL) {
  482. $sp78b2d4 = explode(',', $this->EXTRA);
  483. return $sp78b2d4[0];
  484. }
  485. else if (!$this->esWebExterna()) {
  486. $spab9529 = pathinfo($this->EXTRA);
  487. return $spab9529['basename'];
  488. }
  489. }
  490.  
  491. return '';
  492. }
  493.  
  494. public function getNombre($sp4b7347 = false)
  495. {
  496. if (($this->NOMBRE == '') && $sp4b7347) {
  497. return $this->getCurso('nombre');
  498. }
  499. else {
  500. return $this->NOMBRE;
  501. }
  502. }
  503.  
  504. public function getSecuencia()
  505. {
  506. return $this->SECUENCIA;
  507. }
  508.  
  509. public function getSecuenciaArray()
  510. {
  511. return $this->SECUENCIA ? explode(',', $this->SECUENCIA) : array();
  512. }
  513.  
  514. public function getOrden()
  515. {
  516. return $this->ORDEN;
  517. }
  518.  
  519. public function getDescripcion()
  520. {
  521. return $this->DESCRIPCION;
  522. }
  523.  
  524. public function getDescripcionRepositorio()
  525. {
  526. $sp98650a = $this->DESCRIPCION;
  527.  
  528. if ($sp98650a == '') {
  529. if ($this->getIDCurso()) {
  530. $sp98650a = $this->getCurso('desc');
  531. }
  532. }
  533.  
  534. if ($this->autorEsEditorial()) {
  535. return $sp98650a;
  536. }
  537.  
  538. if ($sp98650a == '') {
  539. if ($this->esWebExterna()) {
  540. $sp98650a = 'URL: ' . $this->EXTRA;
  541. }
  542. else if ($this->esArchivo()) {
  543. $spc93183 = $this->EXTRA;
  544. $sp0b14d3 = strrpos($spc93183, '/');
  545.  
  546. if (($sp0b14d3 !== false) && ($sp0b14d3 < strlen($spc93183))) {
  547. $spc93183 = substr($spc93183, $sp0b14d3 + 1);
  548. $sp98650a = $spc93183;
  549. }
  550. }
  551. }
  552.  
  553. return $sp98650a;
  554. }
  555.  
  556. public function getCodigoCorto()
  557. {
  558. return $this->CODIGO_CORTO;
  559. }
  560.  
  561. public function getDominio()
  562. {
  563. if (!$this->DOMINIO && $this->IDCURSO) {
  564. return $this->getCurso('dominio');
  565. }
  566. else {
  567. return $this->DOMINIO;
  568. }
  569. }
  570.  
  571. public function getTiempoLimite()
  572. {
  573. return $this->TIEMPOLIMITE;
  574. }
  575.  
  576. public function getVisible()
  577. {
  578. return $this->VISIBLE;
  579. }
  580.  
  581. public function getBorrado()
  582. {
  583. return $this->BORRADO;
  584. }
  585.  
  586. public function getPonderacion()
  587. {
  588. return $this->PONDERACION;
  589. }
  590.  
  591. public function getNumCopys()
  592. {
  593. $sp93737d = parent::getNumCopys();
  594.  
  595. if ($sp93737d === false) {
  596. $sp93737d = parent::getNumCopysFromDB($this->getIDCurso(), $this->getID());
  597. $this->NUM_COPYS = $sp93737d;
  598. }
  599.  
  600. return $sp93737d;
  601. }
  602.  
  603. public function getIdLtiContentProvider()
  604. {
  605. if (($this->TIPO_CLASE == TIPO_CLASE_WEB) && !$this->SCORM_VERSION) {
  606. if (filter_var($this->SETTINGS, FILTER_VALIDATE_INT) !== false) {
  607. return $this->SETTINGS;
  608. }
  609. else {
  610. return false;
  611. }
  612. }
  613. else {
  614. return false;
  615. }
  616. }
  617.  
  618. public function getExtra($sp609aa4 = false, $speb65b5 = false, $sp08cf82 = true)
  619. {
  620. $sp96fff3 = $this->EXTRA;
  621. $sp609aa4 &= strpos($sp96fff3, '/coursePlayer/') === false;
  622. $sp4a0429 = false;
  623.  
  624. if ($sp609aa4) {
  625. $sp3af454 = explode(',', $sp96fff3);
  626.  
  627. if (2 < count($sp3af454)) {
  628. $sp7a5ed8 = $sp96fff3;
  629. $sp4a0429 = true;
  630. $sp96fff3 = $sp3af454[1];
  631. $sp8b2e21 = $sp96fff3;
  632. }
  633.  
  634. if ((strpos($sp96fff3, '/' . FILE_SCORM_DIRNAME) !== false) || (strpos($sp96fff3, '/' . FILE_OTHER_IMPORTED_DIRNAME) !== false) || (strpos($sp96fff3, '/' . FILE_IMPORTED_DIRNAME) !== false)) {
  635. $spbaf621 = FILE_COURSE_APP_NAME;
  636. $sp57387f = $this->getIDCurso();
  637. }
  638. else {
  639. $spbaf621 = FILE_ACTIVITY_APP_NAME;
  640. $sp57387f = $this->getID();
  641. }
  642.  
  643. $spdad0c6 = false;
  644. $sp96fff3 = ObjectFactory::invokeStatic(ObjectFactory::File)->getLogicalPath_forResource($sp96fff3, $spbaf621, $sp57387f, false, false, $speb65b5, $spdad0c6, $sp08cf82);
  645.  
  646. if ($sp4a0429) {
  647. $sp96fff3 = str_replace($sp8b2e21, $sp96fff3, $sp7a5ed8);
  648. }
  649. }
  650.  
  651. return $sp96fff3;
  652. }
  653.  
  654. public function addLTIProviderContext($sp6b32ee)
  655. {
  656. if (strpos($sp6b32ee, '/coursePlayer/accessLTIProvider.php?') !== false) {
  657. $sp6b32ee = str_replace('accessLTIProvider.php?', 'accessLTIProvider.php?idcurso=' . $this->IDCURSO . '&idtema=' . $this->IDTEMA . '&idclase=' . $this->IDCLASE . '&', $sp6b32ee);
  658. }
  659.  
  660. return $sp6b32ee;
  661. }
  662.  
  663. public function getFirstPageAlign()
  664. {
  665. $spf7d841 = explode(',', $this->EXTRA);
  666. return array_key_exists(5, $spf7d841) ? $spf7d841[5] : '';
  667. }
  668.  
  669. public function getPageMode()
  670. {
  671. $spf7d841 = explode(',', $this->EXTRA);
  672. return array_key_exists(8, $spf7d841) ? $spf7d841[8] : 'default';
  673. }
  674.  
  675. public function getPagesOffset()
  676. {
  677. $spf7d841 = explode(',', $this->EXTRA);
  678. return array_key_exists(9, $spf7d841) ? $spf7d841[9] : '';
  679. }
  680.  
  681. public function getImagen($sp609aa4 = false)
  682. {
  683. $sp93579f = $this->IMAGEN;
  684.  
  685. if ($sp609aa4 && (strpos($this->IMAGEN, '://') === false)) {
  686. $spbaf621 = FILE_ACTIVITY_APP_NAME;
  687. $sp57387f = $this->getID();
  688. $sp93579f = ObjectFactory::invokeStatic(ObjectFactory::File)->getLogicalPath_forResource($sp93579f, $spbaf621, $sp57387f);
  689. }
  690.  
  691. return $sp93579f;
  692. }
  693.  
  694. public function getImagenOrIcon()
  695. {
  696. if ($this->IMAGEN == '') {
  697. $this->setImagenAleatoria();
  698. }
  699.  
  700. if ($this->IMAGEN != '') {
  701. return $this->getImagen(true);
  702. }
  703.  
  704. if ($this->TIPO_CLASE == TIPO_CLASE_WEB) {
  705. if (strpos($this->EXTRA, '://') !== false) {
  706. return '../images/i/iconos/docu_maxi.png';
  707. }
  708.  
  709. return '../images/i/iconos/enlace_maxi.png';
  710. }
  711.  
  712. return '../images/i/iconos/docu.png';
  713. }
  714.  
  715. public function getThumbnailFilePathCustom($spe9dd93 = 0, $sp5bfe65 = 0, $sp77bd94 = false)
  716. {
  717. if (($spe9dd93 == 0) && ($sp5bfe65 == 0) && !$sp77bd94 && isset($this->_imagePath)) {
  718. return $this->_imagePath;
  719. }
  720.  
  721. if (($spe9dd93 == static::THUMBNAIL_DEFAULT_WIDTH) && ($sp5bfe65 == static::THUMBNAIL_DEFAULT_HEIGHT) && !$sp77bd94 && isset($this->_imagePath_thumbnail)) {
  722. return $this->_imagePath_thumbnail;
  723. }
  724.  
  725. if ($this->IMAGEN == '') {
  726. return $this->getImagenOrIcon();
  727. }
  728.  
  729. if (strpos($this->IMAGEN, '://') !== false) {
  730. return $this->IMAGEN;
  731. }
  732.  
  733. global $prefijoURL;
  734.  
  735. if (startsWith($this->IMAGEN, '/images/default') || startsWith($this->IMAGEN, '/images/common')) {
  736. return $prefijoURL . $this->IMAGEN;
  737. }
  738.  
  739. $sp3af454 = pathinfo($this->IMAGEN);
  740.  
  741. if ((strpos($this->IMAGEN, FILE_RESOURCES_PATH) !== false) || (strpos($this->IMAGEN, '/' . FILE_RESOURCES_SHORT_PATH) !== false)) {
  742. $spa38187 = ObjectFactory::invokeStatic(ObjectFactory::File)->getFileFromPath($this->IMAGEN, FILE_ACTIVITY_APP_NAME, $this->getID());
  743. }
  744. else {
  745. $spa38187 = ObjectFactory::invokeStatic(ObjectFactory::File)->getFileFromPath($this->IMAGEN);
  746. }
  747.  
  748. if (!$spa38187) {
  749. if ($this->getIDClaseOriginal()) {
  750. $spa38187 = ObjectFactory::invokeStatic(ObjectFactory::File)->getFileFromPath($this->IMAGEN, FILE_ACTIVITY_APP_NAME, $this->getIDClaseOriginal());
  751. }
  752. }
  753.  
  754. $sp57286e = '';
  755.  
  756. if ($spa38187) {
  757. if (($spe9dd93 == 0) && ($sp5bfe65 == 0)) {
  758. $sp57286e = $spa38187->getLogicalName();
  759. }
  760. else {
  761. $sp57286e = $spa38187->getThumbnail($spe9dd93, $sp5bfe65, false);
  762.  
  763. if (!$sp57286e) {
  764. $sp57286e = '';
  765. }
  766. }
  767. }
  768. else {
  769. $sp57286e = $this->getImagenOrIcon();
  770. }
  771.  
  772. if (($spe9dd93 == 0) && ($sp5bfe65 == 0) && !$sp77bd94 && !isset($this->_imagePath)) {
  773. $this->_imagePath = $sp57286e;
  774. }
  775.  
  776. if (($spe9dd93 == static::THUMBNAIL_DEFAULT_WIDTH) && ($sp5bfe65 == static::THUMBNAIL_DEFAULT_HEIGHT) && !$sp77bd94 && !isset($this->_imagePath_thumbnail)) {
  777. $this->_imagePath_thumbnail = $sp57286e;
  778. }
  779.  
  780. return $sp57286e;
  781. }
  782.  
  783. public function getThumbnailFilePathDefault($sp77bd94 = false)
  784. {
  785. return $this->getThumbnailFilePathCustom(static::THUMBNAIL_DEFAULT_WIDTH, static::THUMBNAIL_DEFAULT_HEIGHT, $sp77bd94);
  786. }
  787.  
  788. public function getThumbnailFilePathAttachment($sp77bd94 = false)
  789. {
  790. return $this->getThumbnailFilePathCustom(static::THUMBNAIL_ATTACHMENT_WIDTH, static::THUMBNAIL_ATTACHMENT_HEIGHT, $sp77bd94);
  791. }
  792.  
  793. public function getThumbnailFilePathResource($sp77bd94 = false)
  794. {
  795. return $this->getThumbnailFilePathCustom(static::THUMBNAIL_RESOURCE_WIDTH, static::THUMBNAIL_RESOURCE_HEIGHT, $sp77bd94);
  796. }
  797.  
  798. public function setImagenAleatoria()
  799. {
  800. $db = BlinkFactory::getDatabase();
  801. $this->IMAGEN = $this->getImagenAleatoria();
  802. $db->execute('UPDATE blinkfw_activities SET IMAGEN=\'' . formatearParaDB($this->IMAGEN) . '\' WHERE IDCLASE=\'' . formatearParaDB($this->IDCLASE) . '\'');
  803. $this->_borrarObjetoCache();
  804. }
  805.  
  806. public function getImagenAleatoria()
  807. {
  808. $sp2c8bd9 = $this->ImagenesAleatorias();
  809. return $sp2c8bd9[rand(0, count($sp2c8bd9) - 1)];
  810. }
  811.  
  812. static public function ImagenesAleatorias()
  813. {
  814. return array('/images/default/water_foto_500_400.jpg', '/images/default/aquarium_foto_500_400.jpg', '/images/default/ID50854771_500_400.jpg', '/images/default/ID9218407_500_400.jpg', '/images/default/orange_tree_foto_500_400.jpg', '/images/default/bee_2_foto_500_400.jpg', '/images/default/ID47318488_500_400.jpg', '/images/default/ID50842963_500_400.jpg', '/images/default/mountain_foto_500_400.jpg', '/images/default/ID49508491_500_400.jpg');
  815. }
  816.  
  817. public function tieneImagenAleatoria()
  818. {
  819. $sp2c1eac = $this->ImagenesAleatorias();
  820. return in_array($this->IMAGEN, $sp2c1eac);
  821. }
  822.  
  823. public function getSettings()
  824. {
  825. return $this->SETTINGS;
  826. }
  827.  
  828. public function getIDClaseExt()
  829. {
  830. return $this->IDCLASE_EXT;
  831. }
  832.  
  833. public function getNivelIndice()
  834. {
  835. return $this->NIVEL_INDICE;
  836. }
  837.  
  838. public function getIDUsuarioAutor()
  839. {
  840. return $this->IDUSUARIOAUTOR;
  841. .......................................................................................
  842. ..................................................
  843. .................
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement