$injector->defineParam($name, $value); } $injector->alias(\ImagickDemo\Navigation\Nav::class, \ImagickDemo\Navigation\CategoryNav::class); $injector->define(\ImagickDemo\Navigation\CategoryNav::class, [':category' => $category, ':example' => $functionName]); $categoryNav = $injector->make(\ImagickDemo\Navigation\CategoryNav::class); $exampleDefinition = $categoryNav->getExampleDefinition($category, $functionName); $function = $exampleDefinition[0]; $controlClass = $exampleDefinition[1]; if (array_key_exists('defaultParams', $exampleDefinition) == true) { foreach ($exampleDefinition['defaultParams'] as $name => $value) { $defaultName = 'default' . ucfirst($name); $injector->defineParam($defaultName, $value); } } //delegateAllTheThings($injector, $controlClass); $filename = getImageCacheFilename($category, $functionName . ".compare", $params); $extensions = [".jpg", '.jpeg', ".gif", ".png"]; $fileExtension = false; foreach ($extensions as $extension) { $filenameWithExtension = $filename . $extension; if (file_exists($filenameWithExtension) == true) { $fileExtension = $extension; } } if ($fileExtension === false) { echo "File {$filename} does not exist creating.\n"; generateCompare($injector, $functionFullname, $filename); } else { compareFile($injector, $functionFullname, $filename, $fileExtension); } }
function getFilesStatus() { include_once XOOPS_ROOT_PATH . '/modules/mpmanager/class/class.FS_Storage.php'; global $xoopsModuleConfig, $xoopsDB, $module_handler; $sql = 'SELECT conf_id FROM ' . $xoopsDB->prefix('config') . ' WHERE conf_name = "theme_set"'; $res = $xoopsDB->query($sql); list($conf_id) = $xoopsDB->fetchRow($res); $module =& $module_handler->getByDirname('system'); $config_handler =& xoops_gethandler('config'); $config_theme = $config_handler->getConfig($conf_id, true); $i = 0; if (defined("ICMS_LIBRARIES_PATH")) { $mp_files[$i]['path'] = 'libraries/smarty/icms_plugins/function.xoManager.php'; $mp_files[$i]['desc'] = 'Display a popup, an image or an animation for send a warning to user. It can be used in the theme or in the template file'; $mp_files[$i]['action'] = 'new'; $i++; $mp_files[$i]['path'] = 'libraries/smarty/icms_plugins/function.xoManagerCount.php'; $mp_files[$i]['desc'] = 'Count new message'; $mp_files[$i]['action'] = 'new'; $i++; $mp_files[$i]['path'] = 'libraries/smarty/icms_plugins/function.xoManagerCountAll.php'; $mp_files[$i]['desc'] = 'Count all the message'; $mp_files[$i]['action'] = 'new'; $i++; $mp_files[$i]['path'] = 'libraries/smarty/icms_plugins/function.xoManagerCountRead.php'; $mp_files[$i]['desc'] = 'Count read messages'; $mp_files[$i]['action'] = 'new'; } else { $mp_files[$i]['path'] = 'class/smarty/xoops_plugins/function.xoManager.php'; $mp_files[$i]['desc'] = 'Display a popup, an image or an animation for send a warning to user. It can be used in the theme or in the template file'; $mp_files[$i]['action'] = 'new'; $i++; $mp_files[$i]['path'] = 'class/smarty/xoops_plugins/function.xoManagerCount.php'; $mp_files[$i]['desc'] = 'Count new message'; $mp_files[$i]['action'] = 'new'; $i++; $mp_files[$i]['path'] = 'class/smarty/xoops_plugins/function.xoManagerCountAll.php'; $mp_files[$i]['desc'] = 'Count all the message'; $mp_files[$i]['action'] = 'new'; $i++; $mp_files[$i]['path'] = 'class/smarty/xoops_plugins/function.xoManagerCountRead.php'; $mp_files[$i]['desc'] = 'Count read messages'; $mp_files[$i]['action'] = 'new'; } $i++; $mp_files[$i]['path'] = 'pmlite.php'; $mp_files[$i]['desc'] = 'Popup for send message'; $mp_files[$i]['action'] = 'copy'; $i++; $mp_files[$i]['path'] = 'system/blocks/system_block_user.html'; $mp_files[$i]['desc'] = 'System block overload'; $mp_files[$i]['action'] = 'template'; $i++; $mp_files[$i]['path'] = 'system/system_userinfo.html'; $mp_files[$i]['desc'] = 'System UserInfo'; $mp_files[$i]['action'] = 'template'; $i++; $mp_files[$i]['path'] = 'profile/profile_userinfo.html'; $mp_files[$i]['desc'] = 'Module profile UserInfo'; $mp_files[$i]['action'] = 'template'; echo "\r\n <br />\r\n \r\n <table class='outer' cellspacing='1' cellpadding='0'>\r\n <th colspan='3'>" . _MP_PLUGXOOPS . "</th>\r\n "; foreach ($mp_files as $file) { switch ($file['action']) { case 'new': if (file_exists(XOOPS_ROOT_PATH . '/' . $file['path'])) { echo "\r\n <tr>\r\n <td class='odd' style='width:20px;'><img style='margin:2px;' src='../images/OK.png' alt='" . _MP_FILE_OK . "' /></td>\r\n <td class='even'><b>" . $file['path'] . "</b><br /> <i>" . $file['desc'] . "</i></td>\r\n <td class='odd' style='text-align:center;'><form method='POST' action='install.php'><input type='hidden' name='file' value='" . $file['path'] . "' /><input type='hidden' name='action' value='remove' /><input type='submit' class='formButton' value='Remove'></form></td>\r\n </tr>"; } else { echo "\r\n <tr>\r\n <td class='odd' style='width:20px;'><img style='margin:2px;' src='../images/KO.png' alt='" . _MP_FILE_KO . "' /></td>\r\n <td class='even'><b>" . $file['path'] . "</b><br /> <i>" . $file['desc'] . "</i></td>\r\n <td class='odd' style='text-align:center;'><form method='POST' action='install.php'><input type='hidden' name='file' value='" . $file['path'] . "' /><input type='hidden' name='action' value='new' /><input type='submit' class='formButton' value='Install'></form></td>\r\n </tr>"; } break; case 'copy': if (compareFile(XOOPS_ROOT_PATH . '/' . $file['path'], XOOPS_ROOT_PATH . '/modules/mpmanager/Root/' . $file['path'])) { echo "\r\n <tr>\r\n <td class='odd' style='width:20px;'><img style='margin:2px;' src='../images/OK.png' alt='" . _MP_FILE_OK . "' /></td>\r\n <td class='even'><b>" . $file['path'] . "</b><br /> <i>" . $file['desc'] . "</i></td>\r\n <td class='odd' style='text-align:center;'><form method='POST' action='install.php'><input type='hidden' name='file' value='" . $file['path'] . "' /><input type='hidden' name='action' value='restore' /><input type='submit' class='formButton' value='Restore'></form></td>\r\n </tr>"; } else { echo "\r\n <tr>\r\n <td class='odd' style='width:20px;'><img style='margin:2px;' src='../images/KO.png' alt='" . _MP_FILE_KO . "' /></td>\r\n <td class='even'><b>" . $file['path'] . "</b><br /> <i>" . $file['desc'] . "</i></td>\r\n <td class='odd' style='text-align:center;'><form method='POST' action='install.php'><input type='hidden' name='file' value='" . $file['path'] . "' /><input type='hidden' name='action' value='copy' /><input type='submit' class='formButton' value='Install'></form></td>\r\n </tr>"; } break; case 'template': if (file_exists(XOOPS_ROOT_PATH . '/themes/' . $config_theme->getConfValueForOutput() . '/modules/' . $file['path'])) { if (!compareFile(XOOPS_ROOT_PATH . '/themes/' . $config_theme->getConfValueForOutput() . '/modules/' . $file['path'], XOOPS_ROOT_PATH . '/modules/mpmanager/Root/themes/modules/' . $file['path'])) { echo "\r\n <tr>\r\n <td class='odd' style='width:20px;'><img style='margin:2px;' src='../images/KO.png' alt='" . _MP_FILE_KO . "' /></td>\r\n <td class='even'><b>" . $file['path'] . "</b><br /> <i>" . $file['desc'] . "</i></td>\r\n <td class='odd' style='text-align:center;'><form method='POST' action='install.php'><input type='hidden' name='file' value='" . $file['path'] . "' /><input type='hidden' name='action' value='install_template' /><input type='submit' class='formButton' value='Install'></form></td>\r\n </tr>"; } else { echo "\r\n <tr>\r\n <td class='odd' style='width:20px;'><img style='margin:2px;' src='../images/OK.png' alt='" . _MP_FILE_OK . "' /></td>\r\n <td class='even'><b>" . $file['path'] . "</b><br /> <i>" . $file['desc'] . "</i></td>\r\n <td class='odd' style='text-align:center;'><form method='POST' action='install.php'><input type='hidden' name='file' value='" . $file['path'] . "' /><input type='hidden' name='action' value='remove_template' /><input type='submit' class='formButton' value='Remove'></form></td>\r\n </tr>"; } } else { echo "\r\n <tr>\r\n <td class='odd' style='width:20px;'><img style='margin:2px;' src='../images/KO.png' alt='" . _MP_FILE_KO . "' /></td>\r\n <td class='even'><b>" . $file['path'] . "</b><br /> <i>" . $file['desc'] . "</i></td>\r\n <td class='odd' style='text-align:center;'><form method='POST' action='install.php'><input type='hidden' name='file' value='" . $file['path'] . "' /><input type='hidden' name='action' value='install_template' /><input type='submit' class='formButton' value='Install'></form></td>\r\n </tr>"; } break; } } echo "\r\n </table>\r\n \r\n "; }