Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Delete Validation on issue #291 & #45 , Adding Tooltip Capability in Field Configuration (Enhancement) #364

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/cms/cck/dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ public static function renderForm( $field, $value, &$config = array( 'doValidati
}
$label = '';
if ( $field->label ) {
$label = '<label>'.$field->label.$tag.'</label>';
$label = '<label title="'.$field->description.'">'.$field->label.$tag.'</label>';
}
$html = '<li'.$class.'>'.$label.$html.'</li>';

Expand Down
10 changes: 9 additions & 1 deletion plugins/cck_field/button_free/button_free.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,18 @@ public function onCCK_FieldPrepareContent( &$field, $value = '', &$config = arra
if ( isset( $options2['button_link'] ) && $options2['button_link'] ) {
$field1 = (object)array( 'link'=>$options2['button_link'], 'link_options'=>$options2['button_link_options'],
'id'=>$id, 'name'=>$name, 'text'=>htmlspecialchars( $value ), 'value'=>'' );

JCckPluginLink::g_setLink( $field1, $config );
JCckPluginLink::g_setHtml( $field1, 'text' );

if ( isset( $field1->link_onclick ) && $field1->link_onclick ) {
$onclick = $field1->link_onclick;
if($options2['button_link']=="content_delete"){
$onclick = $field1->link_onclick;
$onclick.="else{document.location.href='".$field1->link."'}";
}else {
$onclick = $field1->link_onclick;
}

} elseif ( $field1->link ) {
$onclick = ( isset( $field1->link_target ) && $field1->link_target == '_blank' ) ? 'window.open(\''.$field1->link.'\',\'_blank\')' : 'document.location.href=\''.$field1->link.'\'';
}
Expand Down
30 changes: 28 additions & 2 deletions plugins/cck_field/field_x/field_x.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,33 @@ public static function onCCK_FieldRenderForm( $field, &$config = array() )
}
self::_addScripts( $field->name, array( 'min'=>$field->minlength, 'max'=>$field->maxlength, 'default'=>$field->rows,
'del'=>$field->bool3, 'add'=>$field->bool2, 'drag'=>$field->bool4, 'empty_html'=>$empty ), $config );

//Patch for modal - reinitiate modal, rebind the Add script //By Vic
//if($field->form[0]->type=="jform_media"){ //is form a media ?
if (strpos($html, 'a class="modal') !== false) { // this is a "bit brutal" to detect form but acceptable for fieldx and groupx in one shot
$js="
function reinitModal() {
SqueezeBox.initialize({});
SqueezeBox.assign(jQuery('a.modal').get(), {
parse: 'rel'
});
bindReinit();
}
function bindReinit(){
jQuery('span.icon-plus').click(function(){

setTimeout(function () {
reinitModal()
}, 100);
});
}
jQuery(document).ready(function($) {
bindReinit();
});
";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration( $js );
};
//End Patch
return $html;
}

Expand Down Expand Up @@ -428,4 +454,4 @@ protected static function _getChild( $parent, $config = array() )
return $field;
}
}
?>
?>
31 changes: 29 additions & 2 deletions plugins/cck_field/group_x/group_x.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,34 @@ public static function onCCK_FieldRenderForm( $field, &$config = array() )
self::_addScript( $field->name, array( 'min'=>$field->minlength, 'max'=>$field->maxlength, 'default'=>$field->rows,
'del'=>$field->bool3, 'add'=>$field->bool2, 'drag'=>$field->bool4, 'empty_html'=>$empty ) );
}


//Patch for modal - reinitiate modal, rebind the Add script //By Vic
//if($field->form[0]->type=="jform_media"){ //is form a media ?
if (strpos($html, 'a class="modal') !== false) { // this is a "bit brutal" to detect form but acceptable for fieldx and groupx in one shot
$js="
function reinitModal() {
SqueezeBox.initialize({});
SqueezeBox.assign(jQuery('a.modal').get(), {
parse: 'rel'
});
bindReinit();
}
function bindReinit(){
jQuery('span.icon-plus').click(function(){

setTimeout(function () {
reinitModal()
}, 100);
});
}
jQuery(document).ready(function($) {
bindReinit();
});
";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration( $js );
};
//End Patch
return $html;
}

Expand Down Expand Up @@ -812,4 +839,4 @@ protected static function _getChildren( $parent, $config = array(), $isClient =
return $fields;
}
}
?>
?>