CC-2184: Hardcoded CSS path should be relative path instead

This commit is contained in:
denise 2012-10-19 14:42:01 -04:00
parent 7d8079f770
commit 2527fa2e1a
12 changed files with 31 additions and 33 deletions

View File

@ -67,8 +67,6 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
$view = $this->getResource('view'); $view = $this->getResource('view');
$baseUrl = Application_Common_OsPath::getBaseDir(); $baseUrl = Application_Common_OsPath::getBaseDir();
$CC_CONFIG['base_dir'] = $baseUrl;
$view->headLink()->appendStylesheet($baseUrl.'/css/redmond/jquery-ui-1.8.8.custom.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'/css/redmond/jquery-ui-1.8.8.custom.css?'.$CC_CONFIG['airtime_version']);
$view->headLink()->appendStylesheet($baseUrl.'/css/pro_dropdown_3.css?'.$CC_CONFIG['airtime_version']); $view->headLink()->appendStylesheet($baseUrl.'/css/pro_dropdown_3.css?'.$CC_CONFIG['airtime_version']);

View File

@ -255,7 +255,7 @@ class AudiopreviewController extends Zend_Controller_Action
*/ */
public function getShowAction() public function getShowAction()
{ {
global $CC_CONFIG; $baseUrl = Application_Common_OsPath::getBaseDir();
// disable the view and the layout // disable the view and the layout
$this->view->layout()->disableLayout(); $this->view->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true); $this->_helper->viewRenderer->setNoRender(true);
@ -296,7 +296,7 @@ class AudiopreviewController extends Zend_Controller_Action
throw new Exception("Unknown file type: $mime"); throw new Exception("Unknown file type: $mime");
} }
$elementMap['uri'] = $CC_CONFIG["base_dir"]."/api/get-media/file/".$track['item_id']; $elementMap['uri'] = $baseUrl."/api/get-media/file/".$track['item_id'];
} else { } else {
$elementMap['uri'] = $track['filepath']; $elementMap['uri'] = $track['filepath'];
} }

View File

@ -142,7 +142,7 @@ class LibraryController extends Zend_Controller_Action
public function contextMenuAction() public function contextMenuAction()
{ {
global $CC_CONFIG; $baseUrl = Application_Common_OsPath::getBaseDir();
$id = $this->_getParam('id'); $id = $this->_getParam('id');
$type = $this->_getParam('type'); $type = $this->_getParam('type');
//playlist||timeline //playlist||timeline
@ -184,8 +184,8 @@ class LibraryController extends Zend_Controller_Action
} }
} }
if ($isAdminOrPM) { if ($isAdminOrPM) {
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $CC_CONFIG['base_dir']."/library/delete"); $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $baseUrl."/library/delete");
$menu["edit"] = array("name"=> "Edit Metadata", "icon" => "edit", "url" => $CC_CONFIG['base_dir']."/library/edit-file-md/id/{$id}"); $menu["edit"] = array("name"=> "Edit Metadata", "icon" => "edit", "url" => $baseUrl."/library/edit-file-md/id/{$id}");
} }
$url = $file->getRelativeFileUrl($baseUrl).'/download/true'; $url = $file->getRelativeFileUrl($baseUrl).'/download/true';
@ -212,7 +212,7 @@ class LibraryController extends Zend_Controller_Action
} }
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $CC_CONFIG['base_dir']."/library/delete"); $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $baseUrl."/library/delete");
} }
} elseif ($type == "stream") { } elseif ($type == "stream") {
@ -227,9 +227,9 @@ class LibraryController extends Zend_Controller_Action
} }
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) { if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
if ($screen == "playlist") { if ($screen == "playlist") {
$menu["edit"] = array("name"=> "Edit", "icon" => "edit", "url" => $CC_CONFIG['base_dir']."/library/edit-file-md/id/{$id}"); $menu["edit"] = array("name"=> "Edit", "icon" => "edit", "url" => $baseUrl."/library/edit-file-md/id/{$id}");
} }
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $CC_CONFIG['base_dir']."/library/delete"); $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $baseUrl."/library/delete");
} }
} }
@ -255,7 +255,7 @@ class LibraryController extends Zend_Controller_Action
$text = "Upload to SoundCloud"; $text = "Upload to SoundCloud";
} }
$menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => $CC_CONFIG['base_dir']."/library/upload-file-soundcloud/id/{$id}"); $menu["soundcloud"]["items"]["upload"] = array("name" => $text, "icon" => "soundcloud", "url" => $baseUrl."/library/upload-file-soundcloud/id/{$id}");
} }
if (empty($menu)) { if (empty($menu)) {

View File

@ -174,7 +174,7 @@ class ShowbuilderController extends Zend_Controller_Action
public function contextMenuAction() public function contextMenuAction()
{ {
global $CC_CONFIG; $baseUrl = Application_Common_OsPath::getBaseDir();
$id = $this->_getParam('id'); $id = $this->_getParam('id');
$now = floatval(microtime(true)); $now = floatval(microtime(true));
@ -195,7 +195,7 @@ class ShowbuilderController extends Zend_Controller_Action
if ($now < floatval($item->getDbEnds("U.u")) && $user->canSchedule($instance->getDbShowId())) { if ($now < floatval($item->getDbEnds("U.u")) && $user->canSchedule($instance->getDbShowId())) {
//remove/truncate the item from the schedule //remove/truncate the item from the schedule
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $CC_CONFIG['base_dir']."/showbuilder/schedule-remove"); $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => $baseUrl."/showbuilder/schedule-remove");
} }
$this->view->items = $menu; $this->view->items = $menu;

View File

@ -4,7 +4,7 @@ class Application_Form_EditAudioMD extends Zend_Form
{ {
public function init() public function init()
{ {
global $CC_CONFIG; $baseUrl = Application_Common_OsPath::getBaseDir();
// Set the method for the display form to POST // Set the method for the display form to POST
$this->setMethod('post'); $this->setMethod('post');
@ -136,7 +136,7 @@ class Application_Form_EditAudioMD extends Zend_Form
'ignore' => true, 'ignore' => true,
'class' => 'btn md-cancel', 'class' => 'btn md-cancel',
'label' => 'Cancel', 'label' => 'Cancel',
'onclick' => 'javascript:document.location.href="'.$CC_CONFIG['base_dir'].'/Library"', 'onclick' => 'javascript:document.location.href="'.$baseUrl.'/Library"',
'decorators' => array( 'decorators' => array(
'ViewHelper' 'ViewHelper'
) )

View File

@ -6,9 +6,9 @@ class Application_Form_Preferences extends Zend_Form
public function init() public function init()
{ {
global $CC_CONFIG; $baseUrl = Application_Common_OsPath::getBaseDir();
$this->setAction($CC_CONFIG['base_dir'] . '/Preference'); $this->setAction($baseUrl . '/Preference');
$this->setMethod('post'); $this->setMethod('post');
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true; $isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;

View File

@ -6,7 +6,7 @@
<?php echo $this->headScript() ?> <?php echo $this->headScript() ?>
<?php echo $this->headLink() ?> <?php echo $this->headLink() ?>
<?php echo isset($this->google_analytics)?$this->google_analytics:"" ?> <?php echo isset($this->google_analytics)?$this->google_analytics:"" ?>
<?php global $CC_CONFIG; ?> <?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
</head> </head>
<body> <body>
@ -23,7 +23,7 @@
$this->navigation()->menu()->setPartial($partial); ?> $this->navigation()->menu()->setPartial($partial); ?>
<div class="personal-block solo"> <div class="personal-block solo">
<ul> <ul>
<li><span class="name"><?php echo $this->loggedInAs()?></span> | <a href=<?php echo $CC_CONFIG['base_dir'] . "/Login/logout"?>>Logout</a></li> <li><span class="name"><?php echo $this->loggedInAs()?></span> | <a href=<?php echo $baseUrl . "/Login/logout"?>>Logout</a></li>
</ul> </ul>
</div> </div>

View File

@ -616,7 +616,7 @@ SQL;
public static function searchLibraryFiles($datatables) public static function searchLibraryFiles($datatables)
{ {
global $CC_CONFIG; $baseUrl = Application_Common_OsPath::getBaseDir();
$con = Propel::getConnection(CcFilesPeer::DATABASE_NAME); $con = Propel::getConnection(CcFilesPeer::DATABASE_NAME);
@ -772,14 +772,14 @@ SQL;
// ugly // ugly
if ($type == "au") { if ($type == "au") {
$row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION); $row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
$row['image'] = '<img title="Track preview" src="'.$CC_CONFIG['base_dir'].'/css/images/icon_audioclip.png">'; $row['image'] = '<img title="Track preview" src="'.$baseUrl.'/css/images/icon_audioclip.png">';
} elseif ($type == "pl") { } elseif ($type == "pl") {
$row['image'] = '<img title="Playlist preview" src="'.$CC_CONFIG['base_dir'].'/css/images/icon_playlist.png">'; $row['image'] = '<img title="Playlist preview" src="'.$baseUrl.'/css/images/icon_playlist.png">';
} elseif ($type == "st") { } elseif ($type == "st") {
$row['audioFile'] = $row['id']; $row['audioFile'] = $row['id'];
$row['image'] = '<img title="Webstream preview" src="'.$CC_CONFIG['base_dir'].'/css/images/icon_webstream.png">'; $row['image'] = '<img title="Webstream preview" src="'.$baseUrl.'/css/images/icon_webstream.png">';
} elseif ($type == "bl") { } elseif ($type == "bl") {
$row['image'] = '<img title="Smart Block" src="'.$CC_CONFIG['base_dir'].'/css/images/icon_smart-block.png">'; $row['image'] = '<img title="Smart Block" src="'.$baseUrl.'/css/images/icon_smart-block.png">';
} }
} }

View File

@ -1,5 +1,5 @@
<?php global $CC_CONFIG; ?> <?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<div id="import_status" class="library_import" style="display:none">File import in progress...<img src=<?php echo $CC_CONFIG['base_dir'] . "/css/images/file_import_loader.gif"?>></img></div> <div id="import_status" class="library_import" style="display:none">File import in progress...<img src=<?php $baseUrl . "/css/images/file_import_loader.gif"?>></img></div>
<fieldset class="toggle" id="filter_options"> <fieldset class="toggle" id="filter_options">
<legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span>Advanced Search Options</legend> <legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span>Advanced Search Options</legend>
<div id="advanced_search" class="advanced_search form-horizontal"></div> <div id="advanced_search" class="advanced_search form-horizontal"></div>

View File

@ -1,7 +1,7 @@
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences"> <div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences">
<h2 style="float:left">Preferences</h2> <h2 style="float:left">Preferences</h2>
<?php global $CC_CONFIG; ?> <?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<form method="post" action=<?php echo $CC_CONFIG['base_dir'] . "/Preference/index"?> enctype="application/x-www-form-urlencoded"> <form method="post" action=<?php echo $baseUrl . "/Preference/index"?> enctype="application/x-www-form-urlencoded">
<div class="button-bar bottom" id="submit-element" style="float:right"> <div class="button-bar bottom" id="submit-element" style="float:right">
<input type="submit" class="ui-button ui-state-default right-floated" value="Save" id="Save" name="Save" /> <input type="submit" class="ui-button ui-state-default right-floated" value="Save" id="Save" name="Save" />

View File

@ -1,8 +1,8 @@
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong stream-config"> <div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong stream-config">
<h2 <?php if($this->enable_stream_conf == "true"){?>style="float:left"<?php }?>>Stream Settings</h2> <h2 <?php if($this->enable_stream_conf == "true"){?>style="float:left"<?php }?>>Stream Settings</h2>
<?php global $CC_CONFIG; ?> <?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<?php if($this->enable_stream_conf == "true"){?> <?php if($this->enable_stream_conf == "true"){?>
<form method="post" action=<?php echo $CC_CONFIG['base_dir'] . "/Preference/stream-setting"?> enctype="application/x-www-form-urlencoded" onsubmit="return confirm('<?php echo $this->confirm_pypo_restart_text ?>');"> <form method="post" action=<?php echo $baseUrl . "/Preference/stream-setting"?> enctype="application/x-www-form-urlencoded" onsubmit="return confirm('<?php echo $this->confirm_pypo_restart_text ?>');">
<div class="button-bar bottom" id="submit-element" style="float:right"> <div class="button-bar bottom" id="submit-element" style="float:right">
<input type="submit" class="ui-button ui-state-default right-floated" value="Save" id="Save" name="Save" /> <input type="submit" class="ui-button ui-state-default right-floated" value="Save" id="Save" name="Save" />
</div> </div>

View File

@ -1,7 +1,7 @@
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences"> <div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences">
<h2><?php echo $this->section_title?></h2> <h2><?php echo $this->section_title?></h2>
<?php global $CC_CONFIG; ?> <?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
<form method="post" action=<?php echo $CC_CONFIG['base_dir'] . "/Preference/support-setting"?> enctype="multipart/form-data"> <form method="post" action=<?php echo $baseUrl . "/Preference/support-setting"?> enctype="multipart/form-data">
<div id="support-settings"> <div id="support-settings">
<?php echo $this->statusMsg ?> <?php echo $this->statusMsg ?>
<?php echo $this->form ?> <?php echo $this->form ?>