public function renderPages()
 {
     $i = 0;
     $result = '';
     $pagesList = DbFinder::from('W3sPage')->with('W3sGroup')->orderBy('PageName', 'ASC')->where('ToDelete', '0')->find();
     foreach ($pagesList as $page) {
         $idPage = $page->getId();
         $class = $i % 2 ? "w3s_white_row" : "w3s_yellow_row";
         if ($this->idLanguage . $idPage == $this->currentPage) {
             $class .= '_active';
         }
         $c = new Criteria();
         $c->add(W3sContentPeer::EDITED, 1);
         $edited = $page->countW3sContents($c);
         if ($this->idLanguage . $idPage != $this->currentPage) {
             $changePageFunction = 'InteractiveMenu.hide();W3sTemplate.loadEditorPage(' . $this->idLanguage . ', ' . $idPage . ');';
             $renamePageFunction = '$(\'w3s_page_name_' . $idPage . '\').style.display=\'none\';$(\'w3s_page_name_editor_' . $idPage . '\').style.display=\'block\';';
         } else {
             $changePageFunction = '';
             $renamePageFunction = '';
         }
         $result .= sprintf($this->rowSkeleton, $this->idLanguage . $idPage, $class, $idPage, link_to_function(w3sCommonFunctions::setStringMaxWidth($page->getPageName(), 20), $changePageFunction), $idPage, $this->drawPageEditor($page), link_to_function(w3sCommonFunctions::setStringMaxWidth($page->getW3sGroup()->getGroupName(), 14), $changePageFunction, 'style="color:#FF9900;"'), $edited > 0 ? image_tag(sfConfig::get('app_w3s_web_skin_images_dir') . '/control_panel/button_edited.gif') : ' ', link_to_function(image_tag(sfConfig::get('app_w3s_web_skin_images_dir') . '/control_panel/button_edit.gif', 'alt=' . __('Rename current page') . ' size=14x14'), $renamePageFunction), $this->idLanguage . $idPage != $this->currentPage ? link_to_function(image_tag(sfConfig::get('app_w3s_web_skin_images_dir') . '/control_panel/button_delete.gif', 'alt=' . __('Delete current page') . ' size=14x14'), 'W3sPage.remove(' . $idPage . ', \'' . __('If you delete this page, W3Studio will also delete all contents and metatags related with it: do you want to continue with deleting?') . '\')') : image_tag(sfConfig::get('app_w3s_web_skin_images_dir') . '/control_panel/button_delete_disabled.gif'));
         $i++;
     }
     return $result;
 }
 protected function renderCaption($imageName)
 {
     return sprintf('%s<br />%s%sx%s<br />%s', w3sCommonFunctions::setStringMaxWidth($imageName, 15), sfContext::getInstance()->getI18N()->__('Dim:'), $this->attributes["realWidth"], $this->attributes["realHeight"], sfContext::getInstance()->getI18N()->__('Size:') . $this->attributes["size"]);
 }
 /**
  * Retrieves all the site's pages.
  * 
  * @return array An array where the key is the page's id and the value is the page's name 
  *
  */
 protected function getSitePages()
 {
     $oPages = DbFinder::from('W3sPage')->where('ToDelete', 0)->orderBy('PageName')->find();
     $pages = array('0' => 'Not linked');
     foreach ($oPages as $page) {
         $pages[$page->getId()] = w3sCommonFunctions::setStringMaxWidth($page->getPageName(), 20);
     }
     return $pages;
 }
Beispiel #4
0
 * file that was distributed with this source code.
 *
 * For extra documentation and help please visit http://www.w3studiocms.com
 */
use_helper('I18N', 'Javascript');
$i = 0;
$drags = '';
echo '<ul>';
foreach ($pagesList as $page) {
    $idPage = $page->getId();
    $class = $i / 2 == intval($i / 2) ? "w3s_white_row" : "w3s_yellow_row";
    ?>
    <li id="w3s_page_<?php 
    echo $idPage;
    ?>
" class="<?php 
    echo $class;
    ?>
"><?php 
    echo w3sCommonFunctions::setStringMaxWidth($page->getPageName(), 25);
    ?>
</li>
<?php 
    $drags .= 'new Draggable(\'w3s_page_' . $idPage . '\', {revert:1});';
    $i++;
}
echo '</ul>';
echo javascript_tag($drags);
?>