public function executeRemove($request)
 {
     if ($request->hasParameter('themeName')) {
         $theme = new w3sThemeImport();
         $theme->remove($request->getParameter('themeName'));
         return $this->renderPartial('refresh');
     } else {
         $this->getResponse()->setStatusCode(404);
         $message = w3sCommonFunctions::toI18n('themeName parameter is required.');
         return $this->renderText(w3sCommonFunctions::displayMessage($message, 'error', true));
     }
 }
 /**
  * Overrides the standard function
  * 
  * @return string  The rendered page 
  *
  */
 public function renderPage()
 {
     $slotNames = '';
     if ($this->idLanguage != -1 && $this->idPage != -1) {
         $slotContents = $this->getSlotContents($this->idLanguage, $this->idPage);
         foreach ($slotContents as $slot) {
             $slotNames .= sprintf('"%s",', $slot['slotName']);
             $contents = $this->drawSlot($slot);
             $this->pageContents = preg_replace('/\\<\\?php.*?include_slot\\(\'' . $slot['slotName'] . '\'\\).*?\\?\\>/', $contents, $this->pageContents);
         }
         $this->setSortables($slotContents);
     } else {
         $this->pageContents = w3sCommonFunctions::displayMessage('The page or the language requested does not exist anymore in the website');
     }
     // Renders the W3StudioCMS Copyright button. Please do not remove, neither when
     // you override this function. See the function to learn the best way to implement
     // it in your web site. Thank you.
     $this->pageContents = $this->renderCopyright($this->pageContents);
     return $this->pageContents;
 }
<?php

/*
 * This file is part of the w3studioCMS package library and it is distributed 
 * under the LGPL LICENSE Version 2.1. To use this library you must leave 
 * intact this copyright notice.
 *  
 * (c) 2007-2008 Giansimon Diblas <*****@*****.**>
 *  
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * For extra documentation and help please visit http://www.w3studiocms.com
 */
use_helper('I18N', 'Javascript');
/**/
switch ($status) {
    case 1:
        echo $template->renderPage();
        break;
    case 2:
        $message = __('The template cannot be rendered because a required parameter misses.');
        echo w3sCommonFunctions::displayMessage($message);
        break;
    case 4:
        $message = __('Your session has been expired: you must login again.');
        echo w3sCommonFunctions::displayMessage($message);
        break;
}
Beispiel #4
0
<?php

/*
 * This file is part of the w3studioCMS package library and it is distributed 
 * under the LGPL LICENSE Version 2.1. To use this library you must leave 
 * intact this copyright notice.
 *  
 * (c) 2007-2008 Giansimon Diblas <*****@*****.**>
 *  
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * For extra documentation and help please visit http://www.w3studiocms.com
 */
use_helper('I18N');
// Result messages
$type = 'error';
switch ($result) {
    case 0:
        $message = __('An error occoured while deleting record.');
        break;
    case 1:
        $type = 'success_14';
        $message = __('The group has been succesfully deleted!');
        break;
    case 2:
        $message = __('WARNING: A serious error occoured. A required parameter misses. The group cannot be deleted.');
        break;
}
echo w3sCommonFunctions::displayMessage($message, $type, false);
Beispiel #5
0
 * For extra documentation and help please visit http://www.w3studiocms.com
 */
use_helper('I18N', 'Object', 'Javascript');
// If something failed W3StudioCMS shows the add/edit module again
if ($result != 1) {
    $pageEditor = new w3sPageEditor();
    echo $pageEditor->render();
}
// Result messages
switch ($result) {
    case 0:
        $message = __('An error occoured during the save operation. Page not added.');
        break;
    case 1:
        $message = __('Page added succesfully!<br />Loading pages, please wait.');
        break;
    case 2:
        $message = __('This page already exists in the web site: use another name.');
        break;
    case 4:
        $message = __('You must provide a name for the new page.');
        break;
    case 8:
        $message = __('The new page you are inserting cannot be assigned to group provided because it doesn\'t exist anymore');
        break;
    case 16:
        $message = __('The new page you are inserting cannot be assigned to group provided because it has been removed from w3studioCMS');
        break;
}
echo w3sCommonFunctions::displayMessage($message, 'error', false);
 /**
  * Returns the html error message that corresponds to a predefined error number  
  *
  * @param      int The error number.
  * @param      bool optional If true displays extra information
  * 
  * @return     string 
  */
 public function displayError($errorNumber, $showExtraInfo = false)
 {
     /*
     $errorMessage = sprintf('<p class="error_message">%s</p>', $this->errors[$errorNumber]);
     if ($showExtraInfo) $errorMessage .= sprintf('<p style="font: 11px Verdana, Arial, Helvetica, sans-serif; padding:10px; text-align:left;">%s</p>',w3sCommonFunctions::toI18n('You can try to change page, reenter in this page and redo the operation you made.<br /><br />If problem persists you can try to logout, signin again and redo the operation you made.<br /><br />If problem persists too, reports the error to W3StudioCMS web site \'s forum or write to W3StudioCMS\'s assistance.')); 
     */
     $errorMessage = $this->errors[$errorNumber];
     if ($showExtraInfo) {
         $errorMessage .= w3sCommonFunctions::toI18n('You can try to change page, reenter in this page and redo the operation you made.<br /><br />If problem persists you can try to logout, signin again and redo the operation you made.<br /><br />If problem persists too, reports the error to W3StudioCMS web site \'s forum or write to W3StudioCMS\'s assistance.');
     }
     return w3sCommonFunctions::displayMessage($errorMessage);
 }
Beispiel #7
0
<?php

/*
 * This file is part of the w3studioCMS package library and it is distributed 
 * under the LGPL LICENSE Version 2.1. To use this library you must leave 
 * intact this copyright notice.
 *  
 * (c) 2007-2008 Giansimon Diblas <*****@*****.**>
 *  
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * For extra documentation and help please visit http://www.w3studiocms.com
 */
use_helper('I18N');
// Result messages
switch ($result) {
    case 0:
        $message = __('An error occoured while moving the requested content.');
        $type = "error";
        $closeLink = true;
        break;
    case 1:
        $message = __('The content has been correctly moved.');
        $type = "success_14";
        $closeLink = false;
        break;
}
echo w3sCommonFunctions::displayMessage($message, $type, $closeLink);