Skip to content

Commit

Permalink
New metadata management and translator fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlucena78 committed Mar 5, 2019
1 parent 6ec5b9c commit 15def44
Show file tree
Hide file tree
Showing 151 changed files with 3,487 additions and 3,064 deletions.
4 changes: 2 additions & 2 deletions api/src/actions/LoginAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ public static function login(Request $request, Response $response)

public static function getMe(Request $r, Response $w)
{
$userID = (int)Session::get('userID');
$userID = (int) Session::get('userID');
$user = new User($userID);
$locale = $user->get('Locale');
$locale = !is_null($locale) ? $locale : 'en_US';
$locale = ! is_null($locale) ? $locale : 'en_US';
$response = [
'id' => $userID,
'username' => $user->get('Login'),
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
"phpseclib/phpseclib": "2.0.*",
"phpmailer/phpmailer": "^6.0",
"kevinlebrun/colors.php": "1.*",
"ximdex/plata": "1.*",
"ximdex/plata": "dev-master",
"guzzlehttp/guzzle": ">=4.1.4 <7.0",
"ximdex/xedit": "dev-feature_metadata"
},
"require-dev": {
"mockery/mockery": "0.9.*",
"codeception/codeception": "2.3.*"
"mockery/mockery": "1.2.*",
"codeception/codeception": "2.5.*"
},
"autoload": {
"psr-4": {
Expand Down
47 changes: 21 additions & 26 deletions modules/XRAM/Module_XRAM.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* \details &copy; 2011 Open Ximdex Evolution SL [http://www.ximdex.org]
* \details &copy; 2019 Open Ximdex Evolution SL [http://www.ximdex.org]
*
* Ximdex a Semantic Content Management System (CMS)
*
Expand Down Expand Up @@ -29,52 +29,47 @@

class Module_XRAM extends Module
{

public function __construct()
{
// Call Module constructor.
// Call Module constructor
parent::__construct('XRAM', dirname(__FILE__));
// Initialization stuff.

// Initialization stuff
}

function install()
public function install()
{
// Install logic.
// get module from ftp, webdav, subversion, etc...?
// need to be extracted?
// extract and copy files to modules location.
// get constructor SQL
// Install logic
// Get module from ftp, webdav, subversion, etc...?
// Need to be extracted?
// Extract and copy files to modules location.
// Get constructor SQL
$this->loadConstructorSQL("XRAM.constructor.sql");
$install_ret = parent::install();
if ($install_ret) {
// echo "XRAM module has been successfully installed on Ximdex CMS!.\n";
}
return $install_ret;
return parent::install();
}

function uninstall()
public function uninstall()
{

// Uninstall logic.
// get destructor SQL
// Uninstall logic
// Get destructor SQL
$this->loadDestructorSQL("XRAM.destructor.sql");

// Uninstall !
parent::uninstall();
}

function preInstall()
/**
* Check curl extension and Solr PECL extension
*
* {@inheritDoc}
* @see \Ximdex\Modules\Module::preInstall()
*/
public function preInstall()
{
/* Check curl extension and Solr PECL extension */
// PHP-CURL
if (!extension_loaded('curl')) {
// echo "Se necesita tener instalada la extension php-curl\n";
return false;
} else {
// echo "La extension php-curl se ha detectado correctamente.\n";
}

return true;
}

}
49 changes: 30 additions & 19 deletions modules/XSearch/Module_XSearch.class.php
Original file line number Diff line number Diff line change
@@ -1,40 +1,51 @@
<?php

/**
* \details &copy; 2019 Open Ximdex Evolution SL [http://www.ximdex.org]
*
* Ximdex a Semantic Content Management System (CMS)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* See the Affero GNU General Public License for more details.
* You should have received a copy of the Affero GNU General Public License
* version 3 along with Ximdex (see LICENSE file).
*
* If not, visit http://gnu.org/licenses/agpl-3.0.html.
*
* @author Ximdex DevTeam <[email protected]>
* @version $Revision$
*/

use Ximdex\Modules\Module;

\Ximdex\Modules\Manager::file('/src/SolrExporter.php', 'XSearch');
Ximdex\Modules\Manager::file('/src/SolrExporter.php', 'XSearch');

/**
* Class Module_XSearch
*/
class Module_XSearch extends Module
{


//Class constructor
public function __construct()
{
// Call Module constructor.
// Call Module constructor
parent::__construct("XSearch", dirname(__FILE__));
}

/**
* Load SQL constructor
*
* @return bool
*/
function install()
public function install()
{
$this->loadConstructorSQL("XSearch.constructor.sql");
return parent::install();
}

/**
*
*/
function uninstall()
public function uninstall()
{
$this->loadDestructorSQL("XSearch.destructor.sql");
parent::uninstall();
}
}
}
26 changes: 13 additions & 13 deletions modules/Xowl/Module_Xowl.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* \details &copy; 2018 Open Ximdex Evolution SL [http://www.ximdex.org]
* \details &copy; 2019 Open Ximdex Evolution SL [http://www.ximdex.org]
*
* Ximdex a Semantic Content Management System (CMS)
*
Expand Down Expand Up @@ -39,14 +39,14 @@ public function __construct()
parent::__construct('Xowl', dirname(__FILE__));
}

function install()
public function install()
{
// Get constructor SQL
$this->loadConstructorSQL('Xowl.constructor.sql');
return parent::install();
}

function configure($key, $urlService)
public function configure(string $key, string $urlService)
{
App::setValue('EnricherKey', '2jpkhvda52fgffz2kv8x8cuy', true);
App::setValue('Xowl_location', $urlService, true);
Expand All @@ -63,9 +63,17 @@ function configure($key, $urlService)
}
return true;
}

public function uninstall()
{
// Get destructor SQL
$this->loadDestructorSQL('Xowl.destructor.sql');
parent::uninstall();
}

/**
* Ask and check LMF url
*
* @return bool True if the url is ok.
*/
private function defineLMF()
Expand All @@ -84,14 +92,13 @@ private function defineLMF()
return $result;
}


/**
* Check LMF Path doing a request to the url
*
* @param string $lmfUrl Where LMF is installed
* @param string $lmfUrl Where LMF is installed
* @return bool True if the url is ok
*/
private function checkLMFPath($lmfUrl)
private function checkLMFPath(string $lmfUrl)
{
$result = true;
$headers = array(
Expand All @@ -114,11 +121,4 @@ private function checkLMFPath($lmfUrl)
}
return $result;
}

function uninstall()
{
// Get destructor SQL
$this->loadDestructorSQL('Xowl.destructor.sql');
parent::uninstall();
}
}
36 changes: 26 additions & 10 deletions modules/xBlog/Module_xBlog.class.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
<?php

use Ximdex\Modules\Module;

/**
* Class Module_xBlog
* \details &copy; 2019 Open Ximdex Evolution SL [http://www.ximdex.org]
*
* Ximdex a Semantic Content Management System (CMS)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* See the Affero GNU General Public License for more details.
* You should have received a copy of the Affero GNU General Public License
* version 3 along with Ximdex (see LICENSE file).
*
* If not, visit http://gnu.org/licenses/agpl-3.0.html.
*
* @author Ximdex DevTeam <[email protected]>
* @version $Revision$
*/
class Module_xBlog extends Module
{

use Ximdex\Modules\Module;

//Class constructor
class Module_xBlog extends Module
{
public function __construct()
{
// Call Module constructor.
Expand All @@ -27,12 +46,9 @@ function install()
return parent::install();
}

/**
*
*/
function uninstall()
{
$this->loadDestructorSQL("xBlog.destructor.sql");
parent::uninstall();
}
}
}
44 changes: 21 additions & 23 deletions modules/ximIO/Module_ximIO.class.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

/**
* \details &copy; 2011 Open Ximdex Evolution SL [http://www.ximdex.org]
* \details &copy; 2019 Open Ximdex Evolution SL [http://www.ximdex.org]
*
* Ximdex a Semantic Content Management System (CMS)
*
Expand All @@ -24,45 +25,42 @@
* @version $Revision$
*/

class Module_ximIO extends \Ximdex\Modules\Module {

use Ximdex\Modules\Module;

public function __construct() {

// Call Module constructor.
class Module_ximIO extends Module
{
public function __construct()
{
// Call Module constructor
parent::__construct('ximIO', dirname(__FILE__));

// Initialization stuff.

// Initialization stuff
}

function install() {

// Install logic.
public function install()
{
// Install logic

// get module from ftp, webdav, subversion, etc...?
// need to be extracted?
// extract and copy files to modules location.
// Get module from ftp, webdav, subversion, etc...?
// Need to be extracted?
// Extract and copy files to modules location.

// get constructor SQL
// Get constructor SQL
$this->loadConstructorSQL("ximIO.constructor.sql");

// Install !
$install_ret = parent::install();
return $install_ret;

return $install_ret;
}

function uninstall() {

// Uninstall logic.
public function uninstall()
{
// Uninstall logic

// get destructor SQL
// Get destructor SQL
$this->loadDestructorSQL("ximIO.destructor.sql");

// Uninstall !
parent::uninstall();

}

}
Loading

0 comments on commit 15def44

Please sign in to comment.