Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
janul committed Mar 20, 2014
1 parent a0aa8a4 commit c6d5c66
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 21 deletions.
21 changes: 11 additions & 10 deletions application/controllers/providers/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,26 +346,26 @@ function show($id)
$d[$i]['value'] = '<b>' . date('Y-m-d H:i:s',$ent->getLastModified()->format('U')+j_auth::$timeOffset) . '</b>';
$d[++$i]['name'] = lang('rr_entityid');
$d[$i]['value'] = $ent->getEntityId();
$d[++$i]['name'] = lang('rr_providername');
$d[++$i]['name'] = lang('e_orgname');
$d[$i]['value'] = $ent->getName();
$lname = $ent->getLocalName();
$lvalues = '';
if (count($lname)>0)
{
$d[++$i]['name'] = lang('rr_providername') . ' <small>' . lang('localized') . '</small>';
$d[++$i]['name'] = '';//lang('e_orgname') . ' <small>' . lang('localized') . '</small>';
foreach ($lname as $k => $v)
{
$lvalues .= '<b>' . $k . ':</b> ' . $v . '<br />';
}
$d[$i]['value'] = $lvalues;
}
$d[++$i]['name'] = lang('rr_descriptivename');
$d[++$i]['name'] = lang('e_orgdisplayname');
$d[$i]['value'] = '<div id="selectme">' . $ent->getDisplayName() . '</div>';
$ldisplayname = $ent->getLocalDisplayName();
$lvalues = '';
if (count($ldisplayname)>0)
{
$d[++$i]['name'] = lang('rr_descriptivename') . ' <small>' . lang('localized') . '</small>';
$d[++$i]['name'] = '';//lang('e_orgdisplayname') . ' <small>' . lang('localized') . '</small>';
foreach ($ldisplayname as $k => $v)
{
$lvalues .= '<b>' . $k . ':</b> ' . $v . '<br />';
Expand Down Expand Up @@ -426,22 +426,20 @@ function show($id)
$lvalues = '';
if (count($ldescription)>0)
{
$d[++$i]['name'] = lang('rr_description') . ' <small>' . lang('localized') . '</small>';
$d[++$i]['name'] = '';//lang('rr_description') . ' <small>' . lang('localized') . '</small>';
foreach ($ldescription as $k => $v)
{
$lvalues .= '<b>' . $k . ':</b> <div>' . $v . '</div>';
}
$d[$i]['value'] = $lvalues;
}

$d[++$i]['name'] = lang('rr_homeurl');
$d[$i]['value'] = $ent->getHomeUrl() . ' <br /><small>' . lang('rr_notincludedmetadata') . '</small>';
$d[++$i]['name'] = lang('rr_helpdeskurl');
$d[$i]['value'] = $ent->getHelpdeskUrl() . ' <br /><small>' . lang('rr_includedmetadata') . ' &lt;md:OrganizationURL ..../&gt;</small>';
$d[++$i]['name'] = lang('e_orgurl');
$d[$i]['value'] = $ent->getHelpdeskUrl();
$localizedHelpdesk = $ent->getLocalHelpdeskUrl();
if(is_array($localizedHelpdesk) && count($localizedHelpdesk)>0)
{
$d[++$i]['name'] = lang('rr_helpdeskurl').' <small>'.lang('localized') . '</small>';
$d[++$i]['name'] = '';//lang('rr_helpdeskurl').' <small>'.lang('localized') . '</small>';
$lvalues = '';
foreach($localizedHelpdesk as $k=>$v)
{
Expand Down Expand Up @@ -493,6 +491,9 @@ function show($id)
{
$d[$i]['value'] = '<span class="lbl lbl-alert">' . $validfrom . ' <b>--</b> ' . $validto . '</span>';
}
$d[++$i]['name'] = lang('rr_homeurl').' <div class="s2" style="font-weight: normal">'.lang('optinforpurposeonly').'</div>';

$d[$i]['value'] = $ent->getHomeUrl() . ' <br /><small>' . lang('rr_notincludedmetadata') . '</small>';
$result[] = array('section' => 'general', 'title' => '' . lang('tabGeneral') . '', 'data' => $d);


Expand Down
3 changes: 2 additions & 1 deletion application/controllers/providers/Idp_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function show($limit=null)
}
$data['idps_count'] = count($idps);
$linktitlediexp = lang('rr_disexp_link_title');
$lang = MY_Controller::getLang();
foreach ($idps as $i)
{
$i_link = base_url() . "providers/detail/show/" . $i->getId();
Expand Down Expand Up @@ -109,7 +110,7 @@ function show($limit=null)
{
$iconsblock .= $hiddenicon .' ';
}
$displayname = $i->getName();
$displayname = $i->getNameInLang($lang);
if(empty($displayname))
{
$displayname = $i->getEntityId();
Expand Down
3 changes: 2 additions & 1 deletion application/controllers/providers/Sp_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ function show($limit=null)

$data['sps_count'] = count($sps);
$linktitle_disexp = lang('rr_disexp_link_title');
$lang = MY_Controller::getLang();
foreach ($sps as $i)
{
$iconsblock = '';
Expand Down Expand Up @@ -119,7 +120,7 @@ function show($limit=null)
}
$i_link = base_url() . "providers/detail/show/" . $i->getId();
$is_available = $i->getAvailable();
$displayname = $i->getName(50);
$displayname = $i->getNameInLang($lang);
if(empty($displayname))
{
$displayname = $i->getEntityId();
Expand Down
10 changes: 10 additions & 0 deletions application/language/english/rr_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,15 @@
$lang['adminofprov'] = 'Admin of provider';
$lang['askedyourfed'] = 'asked your federation';
$lang['invyourprov'] = 'invited your Provider';

$lang['e_orgname'] = 'OrganizationName';
$lang['e_orgdisplayname'] = 'OrganizationDisplayName';
$lang['e_orgurl'] = 'OrganizationURL';

$lang['e_servicename'] = 'ServiceName';
$lang['e_servicedesc'] = 'ServiceDescription';


$lang['rr_resource'] = 'Resource Name';
$lang['rr_statdefshortname'] = 'Stat definition short name';
$lang['rr_statdefsourceurl'] = 'Source URL to collect from';
Expand Down Expand Up @@ -375,6 +384,7 @@
$lang['rr_certificatesigning'] = 'Certificate for signing';
$lang['rr_certificateencrypting'] = 'Certificate for encryption';
$lang['rr_metadatalocation'] = 'Metadata location (optional)';
$lang['optinforpurposeonly'] = 'optional for information purpose only';
$lang['rr_privacystatement'] = 'Privacy Statement URL (optional)';
$lang['rr_defaultprivacyurl'] = 'Default Privacy Statement URL';
$lang['rr_scope'] = 'Scope';
Expand Down
14 changes: 7 additions & 7 deletions application/libraries/Form_element.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function NgenerateEntityGeneral(models\Provider $ent, $ses = null)
*/
//$result[] = '<div class="notice">'.lang('rr_providername').' <small>&#91;'.lang('rr_default').'&#93;</small> </div>';
// $result[] = '';
$result[] = form_label(lang('rr_providername').' '.showBubbleHelp(''.lang('entname_default_expl').''), 'f[orgname]') . form_input(array('id' => 'f[orgname]', 'class' => $class_org, 'name' => 'f[orgname]', 'required' => 'required', 'value' => $t2));
$result[] = form_label(lang('e_orgname').' '.showBubbleHelp(''.lang('entname_default_expl').''), 'f[orgname]') . form_input(array('id' => 'f[orgname]', 'class' => $class_org, 'name' => 'f[orgname]', 'required' => 'required', 'value' => $t2));
/**
* start lname
*/
Expand Down Expand Up @@ -317,7 +317,7 @@ public function NgenerateEntityGeneral(models\Provider $ent, $ses = null)
{
$lnamenotice = 'notice';
}
$result[] = form_label(lang('rr_providername') . ' <small>' . $lnamelangs['' . $key . ''] . '</small>', 'f[lname][' . $key . ']') . form_input(
$result[] = form_label(lang('e_orgname') . ' <small>' . $lnamelangs['' . $key . ''] . '</small>', 'f[lname][' . $key . ']') . form_input(
array(
'name' => 'f[lname][' . $key . ']',
'id' => 'f[lname][' . $key . ']',
Expand All @@ -342,7 +342,7 @@ public function NgenerateEntityGeneral(models\Provider $ent, $ses = null)
{
$lnamenotice = 'notice';
}
$result[] = form_label(lang('rr_providername') . ' <small>' . $lnamelangs['' . $key . ''] . '</small>', 'f[lname][' . $key . ']') . form_input(
$result[] = form_label(lang('e_orgname') . ' <small>' . $lnamelangs['' . $key . ''] . '</small>', 'f[lname][' . $key . ']') . form_input(
array(
'name' => 'f[lname][' . $key . ']',
'id' => 'f[lname][' . $key . ']',
Expand All @@ -353,7 +353,7 @@ public function NgenerateEntityGeneral(models\Provider $ent, $ses = null)
unset($lnamelangs['' . $key . '']);
}
}
$result[] = '<span class="lnameadd">' . form_dropdown('lnamelangcode', MY_Controller::$langselect, $this->defaultlangselect) . '<button type="button" id="addlname" name="addlname" value="'.lang('rr_providername').'" class="editbutton addicon smallerbtn">'.lang('btnaddinlang').'</button></span>';
$result[] = '<span class="lnameadd">' . form_dropdown('lnamelangcode', MY_Controller::$langselect, $this->defaultlangselect) . '<button type="button" id="addlname" name="addlname" value="'.lang('e_orgname').'" class="editbutton addicon smallerbtn">'.lang('btnaddinlang').'</button></span>';

$result[] = '';
/**
Expand All @@ -363,7 +363,7 @@ public function NgenerateEntityGeneral(models\Provider $ent, $ses = null)


$result[] = '';
$result[] = form_label(lang('rr_displayname').' '.showBubbleHelp(''.lang('entdisplname_default_expl').''), 'f[displayname]') . form_input(array('id' => 'f[displayname]', 'class' => $class_displ, 'name' => 'f[displayname]', 'required' => 'required', 'value' => $f_displayname));
$result[] = form_label(lang('e_orgdisplayname').' '.showBubbleHelp(''.lang('entdisplname_default_expl').''), 'f[displayname]') . form_input(array('id' => 'f[displayname]', 'class' => $class_displ, 'name' => 'f[displayname]', 'required' => 'required', 'value' => $f_displayname));
/**
* start ldisplayname
*/
Expand Down Expand Up @@ -396,7 +396,7 @@ public function NgenerateEntityGeneral(models\Provider $ent, $ses = null)
}
if(isset($ldisplaynamelangs['' . $key . '']))
{
$result[] = form_label(lang('rr_displayname') . ' <small>' . $ldisplaynamelangs['' . $key . ''] . '</small>', 'f[ldisplayname][' . $key . ']') . form_input(
$result[] = form_label(lang('e_orgdisplayname') . ' <small>' . $ldisplaynamelangs['' . $key . ''] . '</small>', 'f[ldisplayname][' . $key . ']') . form_input(
array(
'name' => 'f[ldisplayname][' . $key . ']',
'id' => 'f[ldisplayname][' . $key . ']',
Expand All @@ -418,7 +418,7 @@ public function NgenerateEntityGeneral(models\Provider $ent, $ses = null)
{
$ldisplaynamenotice = 'notice';
}
$result[] = form_label(lang('rr_displayname') . ' <small>' . $ldisplaynamelangs['' . $key . ''] . '</small>', 'f[ldisplayname][' . $key . ']') . form_input(
$result[] = form_label(lang('e_orgdisplayname') . ' <small>' . $ldisplaynamelangs['' . $key . ''] . '</small>', 'f[ldisplayname][' . $key . ']') . form_input(
array(
'name' => 'f[ldisplayname][' . $key . ']',
'id' => 'f[ldisplayname][' . $key . ']',
Expand Down
15 changes: 15 additions & 0 deletions application/models/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,21 @@ public function getNameLocalized()
return $p;
}

public function getNameInLang($lang)
{
$r = $this->getNameLocalized();
if(isset($r[''.$lang.'']))
{
return $r[''.$lang.''];
}
else
{
return $r['en'] ;
}

}


public function getDisplayName($length = null)
{
if (empty($length) or !is_integer($length) or strlen($this->displayname) <= $length)
Expand Down
2 changes: 1 addition & 1 deletion application/views/providers/idp_list_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
$tmpl = array('table_open' => '<table id="details" class="zebra drop-shadow lifted idplist filterlist">');

$this->table->set_template($tmpl);
$this->table->set_heading(lang('tbl_title_nameandentityid'),'#', lang('tbl_title_regdate'), lang('tbl_title_helpurl'));
$this->table->set_heading(lang('e_orgname').'/entityID','#', lang('tbl_title_regdate'), lang('tbl_title_helpurl'));
echo $this->table->generate($idprows);
$this->table->clear();
?>
Expand Down
2 changes: 1 addition & 1 deletion application/views/providers/sp_list_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
$tmpl = array('table_open' => '<table id="details" class="zebra splist filterlist">');

$this->table->set_template($tmpl);
$this->table->set_heading(lang('tbl_title_nameandentityid'),'#',lang('tbl_title_regdate'), lang('tbl_title_helpurl'));
$this->table->set_heading(lang('e_orgname') .'/entityID','#',lang('tbl_title_regdate'), lang('tbl_title_helpurl'));
echo $this->table->generate($sprows);
$this->table->clear();
?>

0 comments on commit c6d5c66

Please sign in to comment.