BUG 10459 I added validate to plugin disabled IMPROVEMENT
This commit is contained in:
@@ -347,23 +347,14 @@ class PMDashlet extends DashletInstance implements DashletInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function setIncludePath ()
|
public static function verifyPluginDashlet ($className)
|
||||||
{
|
|
||||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
|
||||||
$pluginsDashlets = $oPluginRegistry->getDashlets();
|
|
||||||
foreach ($pluginsDashlets as $pluginDashlet) {
|
|
||||||
set_include_path( get_include_path() . PATH_SEPARATOR . PATH_PLUGINS . $pluginDashlet . PATH_SEP );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static function verifyPluginDashlet ($className)
|
|
||||||
{
|
{
|
||||||
// 1-- if name class is in core
|
// 1-- if name class is in core
|
||||||
$fileExist = PATH_CORE . 'classes' . PATH_SEP . 'class.' . $className . '.php';
|
$fileExist = PATH_CORE . 'classes' . PATH_SEP . 'class.' . $className . '.php';
|
||||||
if (file_exists($fileExist)) {
|
if (file_exists($fileExist)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2-- if name class is in plugin
|
// 2-- if name class is in plugin
|
||||||
|
|
||||||
//---- verify the name plugin of the class
|
//---- verify the name plugin of the class
|
||||||
@@ -372,13 +363,13 @@ class PMDashlet extends DashletInstance implements DashletInterface
|
|||||||
$pluginsDashlets = $oPluginRegistry->getDashlets();
|
$pluginsDashlets = $oPluginRegistry->getDashlets();
|
||||||
|
|
||||||
foreach ($pluginsDashlets as $pluginDashlet) {
|
foreach ($pluginsDashlets as $pluginDashlet) {
|
||||||
$fileExist = PATH_PLUGINS . $pluginDashlet . PATH_SEP . $pluginDashlet . PATH_SEP . 'classes' . PATH_SEP . 'class.' . $className . '.php';
|
$fileExist = PATH_PLUGINS . $pluginDashlet . PATH_SEP . 'classes' . PATH_SEP . 'class.' . $className . '.php';
|
||||||
if (file_exists($fileExist)) {
|
if (file_exists($fileExist)) {
|
||||||
$pluginName = $pluginDashlet;
|
$pluginName = $pluginDashlet;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---- verify if the plugin is active
|
//---- verify if the plugin is active
|
||||||
if ($pluginName == '') {
|
if ($pluginName == '') {
|
||||||
return false;
|
return false;
|
||||||
@@ -402,4 +393,13 @@ class PMDashlet extends DashletInstance implements DashletInterface
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static function setIncludePath ()
|
||||||
|
{
|
||||||
|
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||||
|
$pluginsDashlets = $oPluginRegistry->getDashlets();
|
||||||
|
foreach ($pluginsDashlets as $pluginDashlet) {
|
||||||
|
set_include_path( get_include_path() . PATH_SEPARATOR . PATH_PLUGINS . $pluginDashlet . PATH_SEP );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ class Dashboard extends Controller
|
|||||||
foreach ($dashletsExist as $key => $value) {
|
foreach ($dashletsExist as $key => $value) {
|
||||||
$listDashletAux[$value['DAS_INS_UID']] = $key;
|
$listDashletAux[$value['DAS_INS_UID']] = $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dashletsShow['0'] = array();
|
$dashletsShow['0'] = array();
|
||||||
foreach ($aConfiguration['ORDER']['0'] as $value) {
|
foreach ($aConfiguration['ORDER']['0'] as $value) {
|
||||||
if (isset($listDashletAux[$value])) {
|
if (isset($listDashletAux[$value])) {
|
||||||
@@ -425,6 +425,7 @@ class Dashboard extends Controller
|
|||||||
$criteria = new Criteria( 'workflow' );
|
$criteria = new Criteria( 'workflow' );
|
||||||
$criteria->addSelectColumn( DashletPeer::DAS_UID );
|
$criteria->addSelectColumn( DashletPeer::DAS_UID );
|
||||||
$criteria->addSelectColumn( DashletPeer::DAS_TITLE );
|
$criteria->addSelectColumn( DashletPeer::DAS_TITLE );
|
||||||
|
$criteria->addSelectColumn( DashletPeer::DAS_CLASS );
|
||||||
//ORDER BY
|
//ORDER BY
|
||||||
$criteria->addAscendingOrderByColumn( DashletPeer::DAS_TITLE );
|
$criteria->addAscendingOrderByColumn( DashletPeer::DAS_TITLE );
|
||||||
|
|
||||||
@@ -432,8 +433,9 @@ class Dashboard extends Controller
|
|||||||
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
$dataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||||
$dataset->next();
|
$dataset->next();
|
||||||
while ($row = $dataset->getRow()) {
|
while ($row = $dataset->getRow()) {
|
||||||
$dashlets[] = array ($row['DAS_UID'],$row['DAS_TITLE']
|
if ($this->pmDashlet->verifyPluginDashlet($row['DAS_CLASS'])) {
|
||||||
);
|
$dashlets[] = array ($row['DAS_UID'],$row['DAS_TITLE']);
|
||||||
|
}
|
||||||
$dataset->next();
|
$dataset->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user